From 84457bc7b4434b128041347d83040a66de4bd1f9 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 29 Sep 2016 23:44:49 +0100 Subject: [PATCH] Add scrollOnAdd option to editableList --- editor/js/ui/common/editableList.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/js/ui/common/editableList.js b/editor/js/ui/common/editableList.js index 901cd2bcd..54a2ac3fa 100644 --- a/editor/js/ui/common/editableList.js +++ b/editor/js/ui/common/editableList.js @@ -87,7 +87,10 @@ this.activeFilter = this.options.filter||null; this.activeSort = this.options.sort||null; - + this.scrollOnAdd = this.options.scrollOnAdd; + if (this.scrollOnAdd === undefined) { + this.scrollOnAdd = true; + } var minHeight = this.element.css("minHeight"); if (minHeight !== '0px') { this.uiContainer.css("minHeight",minHeight); @@ -255,7 +258,7 @@ } } - if (!that.activeSort) { + if (!that.activeSort && that.scrollOnAdd) { setTimeout(function() { that.uiContainer.scrollTop(that.element.height()); },0);