Skip to content

Commit

Permalink
Switched "Move Items" Cancel/Okay button orders + variable clean-up.
Browse files Browse the repository at this point in the history
Part of addressing Issue #941.
  • Loading branch information
NHDaly committed Jan 19, 2016
1 parent 9caea4a commit ce24663
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions notebook/static/tree/js/notebooklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,16 @@ define([
};

NotebookList.prototype.move_selected = function() {
var that = this;

// TODO(nhdaly): Support moving multiple items at once.
if (this.selected.length !== 1){
if (that.selected.length !== 1){
return;
}

var that = this;
var item_path = this.selected[0].path;
var item_name = this.selected[0].name;
var item_type = this.selected[0].type;
var item_path = that.selected[0].path;
var item_name = that.selected[0].name;
var item_type = that.selected[0].type;

// Open a dialog to enter the new path, with current path as default.
var input = $('<input/>').attr('type','text').attr('size','25').addClass('form-control')
Expand All @@ -731,6 +732,7 @@ define([
title : "Move "+ item_type,
body : dialog_body,
buttons : {
Cancel : {},
OK : {
class: "btn-primary",
click: function() {
Expand All @@ -753,8 +755,7 @@ define([
console.warn('Error durring moving :', e);
});
}
},
Cancel : {}
}
},
open : function () {
// Upon ENTER, click the OK button.
Expand Down

0 comments on commit ce24663

Please sign in to comment.