From ce246635ff5595cca2de950d2da900c1e3a5044f Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Mon, 18 Jan 2016 22:45:28 -0800 Subject: [PATCH] Switched "Move Items" Cancel/Okay button orders + variable clean-up. Part of addressing Issue #941. --- notebook/static/tree/js/notebooklist.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/notebook/static/tree/js/notebooklist.js b/notebook/static/tree/js/notebooklist.js index 9357d6ebd9..746a3aa390 100644 --- a/notebook/static/tree/js/notebooklist.js +++ b/notebook/static/tree/js/notebooklist.js @@ -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 = $('').attr('type','text').attr('size','25').addClass('form-control') @@ -731,6 +732,7 @@ define([ title : "Move "+ item_type, body : dialog_body, buttons : { + Cancel : {}, OK : { class: "btn-primary", click: function() { @@ -753,8 +755,7 @@ define([ console.warn('Error durring moving :', e); }); } - }, - Cancel : {} + } }, open : function () { // Upon ENTER, click the OK button.