Skip to content

Commit

Permalink
fix restore
Browse files Browse the repository at this point in the history
  • Loading branch information
plrthink committed Oct 7, 2013
1 parent 72a2082 commit b470053
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coursera_alfred",
"version": "0.3.4",
"version": "0.3.5",
"dependencies": {
"jquery": "~1.9.1",
"angular": "~1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Coursera Alfred",
"version": "0.3.4",
"version": "0.3.5",
"manifest_version": 2,
"description": "Your Coursera Helper",
"homepage_url": "http://www.xiuxiu.de/",
Expand Down
2 changes: 1 addition & 1 deletion src/browser_action/browser_action.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</div>
<div class="row-fluid">
<button
class="btn btn-inverse" ng-click="restoreDeadline($index)"
class="btn btn-inverse" ng-click="restoreDeadline(deadline)"
>
Move back
</button>
Expand Down
10 changes: 7 additions & 3 deletions src/browser_action/js/controllers/appCtrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*global todomvc */
'use strict';
app.controller('appCtrl', function AlfredCtrl($scope, alfredStorage, courseService, icon){
app.controller('appCtrl', function AlfredCtrl($scope, $filter, alfredStorage, courseService, icon){

$scope.deadlines = alfredStorage.getDeadlines();

Expand Down Expand Up @@ -36,7 +36,11 @@ app.controller('appCtrl', function AlfredCtrl($scope, alfredStorage, courseServi
removedDeadlines.push(deadline);
};

$scope.restoreDeadline = function(index){
removedDeadlines.splice(index, 1);
$scope.restoreDeadline = function(deadline){
for (var i =0; i < removedDeadlines.length; i++)
if ((removedDeadlines[i].html.length === deadline.html.length) && (removedDeadlines[i].html === deadline.html)) {
removedDeadlines.splice(i,1);
break;
}
};
});

0 comments on commit b470053

Please sign in to comment.