From fcb369a68ad6220f29256799b45fc7416b41903b Mon Sep 17 00:00:00 2001 From: Thomas Young Date: Wed, 27 May 2015 16:17:22 +0200 Subject: [PATCH] added line with variable declarations to stop these being global, removed a bit of spurious whitespace at the end of another line --- cms/static/js/views/list_textbooks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cms/static/js/views/list_textbooks.js b/cms/static/js/views/list_textbooks.js index f10b20a972..70eebd5f4f 100644 --- a/cms/static/js/views/list_textbooks.js +++ b/cms/static/js/views/list_textbooks.js @@ -31,12 +31,13 @@ define(["js/views/baseview", "jquery", "js/views/edit_textbook", "js/views/show_ "click .new-button": "addOne" }, addOne: function(e) { + var $sectionEl, $inputEl; if(e && e.preventDefault) { e.preventDefault(); } this.collection.add([{editing: true}]); // (render() call triggered here) // find the outer 'section' tag for the newly added textbook $sectionEl = this.$el.find('section:last'); // scroll to put this at top of viewport - ViewUtils.setScrollOffset($sectionEl, 0); + ViewUtils.setScrollOffset($sectionEl, 0); // find the first input element in this section $inputEl = $sectionEl.find('input:first'); // activate the text box (so user can go ahead and start typing straight away)