From d77176a5537106ae80f430505b402ec02b925226 Mon Sep 17 00:00:00 2001 From: dhilt Date: Thu, 15 Dec 2016 03:45:43 +0300 Subject: [PATCH 1/4] inject jqLiteExtras service into ui.scroll module --- src/ui-scroll.js | 274 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) diff --git a/src/ui-scroll.js b/src/ui-scroll.js index c9852c98..4e71b965 100644 --- a/src/ui-scroll.js +++ b/src/ui-scroll.js @@ -977,4 +977,278 @@ angular.module('ui.scroll', []) } } } + ]) + .service('jqLiteExtras', [ + '$log', + '$window', + (console, window) => { + return { + registerFor: (element) => { + var convertToPx, css, getStyle, isWindow; + // angular implementation blows up if elem is the window + css = angular.element.prototype.css; + + element.prototype.css = function (name, value) { + let self = this; + let elem = self[0]; + if (!(!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style)) { + return css.call(self, name, value); + } + }; + + // as defined in angularjs v1.0.5 + isWindow = (obj) => obj && obj.document && obj.location && obj.alert && obj.setInterval; + + function scrollTo(self, direction, value) { + let elem = self[0]; + let [method, prop, preserve] = { + top: [ + 'scrollTop', + 'pageYOffset', + 'scrollLeft' + ], + left: [ + 'scrollLeft', + 'pageXOffset', + 'scrollTop' + ] + }[direction]; + + if (isWindow(elem)) { + if (angular.isDefined(value)) { + return elem.scrollTo(self[preserve].call(self), value); + } + + return (prop in elem) ? elem[prop] : elem.document.documentElement[method]; + } else { + if (angular.isDefined(value)) { + elem[method] = value; + } + + return elem[method]; + } + } + + if (window.getComputedStyle) { + getStyle = (elem) => window.getComputedStyle(elem, null); + convertToPx = (elem, value) => parseFloat(value); + } else { + getStyle = (elem) => elem.currentStyle; + convertToPx = (elem, value) => { + let left, result, rs, rsLeft, style; + let core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; + let rnumnonpx = new RegExp('^(' + core_pnum + ')(?!px)[a-z%]+$', 'i'); + + if (!rnumnonpx.test(value)) { + return parseFloat(value); + } + + // ported from JQuery + style = elem.style; + left = style.left; + rs = elem.runtimeStyle; + rsLeft = rs && rs.left; + if (rs) { + rs.left = style.left; + } + // put in the new values to get a computed style out + style.left = value; + result = style.pixelLeft; + style.left = left; + if (rsLeft) { + rs.left = rsLeft; + } + return result; + }; + } + + function getMeasurements(elem, measure) { + let base, borderA, borderB, computedMarginA, computedMarginB, computedStyle, dirA, dirB, marginA, marginB, paddingA, paddingB; + + if (isWindow(elem)) { + base = document.documentElement[{height: 'clientHeight', width: 'clientWidth'}[measure]]; + + return { + base: base, + padding: 0, + border: 0, + margin: 0 + }; + } + + // Start with offset property + [ + base, + dirA, + dirB + ] = { + width: [ + elem.offsetWidth, + 'Left', + 'Right' + ], + height: [ + elem.offsetHeight, + 'Top', + 'Bottom' + ] + }[measure]; + + computedStyle = getStyle(elem); + paddingA = convertToPx(elem, computedStyle['padding' + dirA]) || 0; + paddingB = convertToPx(elem, computedStyle['padding' + dirB]) || 0; + borderA = convertToPx(elem, computedStyle['border' + dirA + 'Width']) || 0; + borderB = convertToPx(elem, computedStyle['border' + dirB + 'Width']) || 0; + computedMarginA = computedStyle['margin' + dirA]; + computedMarginB = computedStyle['margin' + dirB]; + + // I do not care for width for now, so this hack is irrelevant + // if ( !supportsPercentMargin ) + // computedMarginA = hackPercentMargin( elem, computedStyle, computedMarginA ) + // computedMarginB = hackPercentMargin( elem, computedStyle, computedMarginB ) + marginA = convertToPx(elem, computedMarginA) || 0; + marginB = convertToPx(elem, computedMarginB) || 0; + + return { + base: base, + padding: paddingA + paddingB, + border: borderA + borderB, + margin: marginA + marginB + }; + } + + function getWidthHeight(elem, direction, measure) { + let computedStyle, result; + + let measurements = getMeasurements(elem, direction); + + if (measurements.base > 0) { + return { + base: measurements.base - measurements.padding - measurements.border, + outer: measurements.base, + outerfull: measurements.base + measurements.margin + }[measure]; + } + + // Fall back to computed then uncomputed css if necessary + computedStyle = getStyle(elem); + result = computedStyle[direction]; + + if (result < 0 || result === null) { + result = elem.style[direction] || 0; + } + + // Normalize "", auto, and prepare for extra + result = parseFloat(result) || 0; + + return { + base: result - measurements.padding - measurements.border, + outer: result, + outerfull: result + measurements.padding + measurements.border + measurements.margin + }[measure]; + } + + // define missing methods + return angular.forEach({ + before(newElem) { + var children, elem, i, j, parent, ref, self; + self = this; + elem = self[0]; + parent = self.parent(); + children = parent.contents(); + if (children[0] === elem) { + return parent.prepend(newElem); + } else { + for (i = j = 1, ref = children.length - 1; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { + if (children[i] === elem) { + angular.element(children[i - 1]).after(newElem); + return; + } + } + throw new Error('invalid DOM structure ' + elem.outerHTML); + } + }, + height (value){ + var self; + self = this; + if (angular.isDefined(value)) { + if (angular.isNumber(value)) { + value = value + 'px'; + } + return css.call(self, 'height', value); + } else { + return getWidthHeight(this[0], 'height', 'base'); + } + }, + outerHeight(option) { + return getWidthHeight(this[0], 'height', option ? 'outerfull' : 'outer'); + }, + outerWidth(option) { + return getWidthHeight(this[0], 'width', option ? 'outerfull' : 'outer'); + }, + + /* + The offset setter method is not implemented + */ + offset(value) { + let docElem, win; + let self = this; + let box = { + top: 0, + left: 0 + }; + let elem = self[0]; + let doc = elem && elem.ownerDocument; + + if (arguments.length) { + if (value === undefined) { + return self; + } + // TODO: implement setter + throw new Error('offset setter method is not implemented'); + } + + if (!doc) { + return; + } + + docElem = doc.documentElement; + + // TODO: Make sure it's not a disconnected DOM node + + if (elem.getBoundingClientRect != null) { + box = elem.getBoundingClientRect(); + } + + win = doc.defaultView || doc.parentWindow; + + return { + top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), + left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) + }; + }, + scrollTop(value) { + return scrollTo(this, 'top', value); + }, + scrollLeft(value) { + return scrollTo(this, 'left', value); + } + }, (value, key) => { + if (!element.prototype[key]) { + return element.prototype[key] = value; + } + }); + } + }; + } + ]) + .run([ + '$log', + '$window', + 'jqLiteExtras', + function (console, window, jqLiteExtras) { + if (!window.jQuery) { + return jqLiteExtras.registerFor(angular.element); + } + } ]); From 73743b739d4272496458186d0f0548152be5be9a Mon Sep 17 00:00:00 2001 From: dhilt Date: Thu, 15 Dec 2016 03:46:12 +0300 Subject: [PATCH 2/4] remove ui.scroll.jqlite module and fix tests --- src/ui-scroll-jqlite.js | 275 --------------------------------------- test/jqliteExtrasSpec.js | 2 +- 2 files changed, 1 insertion(+), 276 deletions(-) delete mode 100644 src/ui-scroll-jqlite.js diff --git a/src/ui-scroll-jqlite.js b/src/ui-scroll-jqlite.js deleted file mode 100644 index 9ae5bd06..00000000 --- a/src/ui-scroll-jqlite.js +++ /dev/null @@ -1,275 +0,0 @@ -angular.module('ui.scroll.jqlite', ['ui.scroll']) - .service('jqLiteExtras', [ - '$log', - '$window', - (console, window) => { - return { - registerFor: (element) => { - var convertToPx, css, getStyle, isWindow; - // angular implementation blows up if elem is the window - css = angular.element.prototype.css; - - element.prototype.css = function (name, value) { - let self = this; - let elem = self[0]; - if (!(!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style)) { - return css.call(self, name, value); - } - }; - - // as defined in angularjs v1.0.5 - isWindow = (obj) => obj && obj.document && obj.location && obj.alert && obj.setInterval; - - function scrollTo(self, direction, value) { - let elem = self[0]; - let [method, prop, preserve] = { - top: [ - 'scrollTop', - 'pageYOffset', - 'scrollLeft' - ], - left: [ - 'scrollLeft', - 'pageXOffset', - 'scrollTop' - ] - }[direction]; - - if (isWindow(elem)) { - if (angular.isDefined(value)) { - return elem.scrollTo(self[preserve].call(self), value); - } - - return (prop in elem) ? elem[prop] : elem.document.documentElement[method]; - } else { - if (angular.isDefined(value)) { - elem[method] = value; - } - - return elem[method]; - } - } - - if (window.getComputedStyle) { - getStyle = (elem) => window.getComputedStyle(elem, null); - convertToPx = (elem, value) => parseFloat(value); - } else { - getStyle = (elem) => elem.currentStyle; - convertToPx = (elem, value) => { - let left, result, rs, rsLeft, style; - let core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; - let rnumnonpx = new RegExp('^(' + core_pnum + ')(?!px)[a-z%]+$', 'i'); - - if (!rnumnonpx.test(value)) { - return parseFloat(value); - } - - // ported from JQuery - style = elem.style; - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - if (rs) { - rs.left = style.left; - } - // put in the new values to get a computed style out - style.left = value; - result = style.pixelLeft; - style.left = left; - if (rsLeft) { - rs.left = rsLeft; - } - return result; - }; - } - - function getMeasurements(elem, measure) { - let base, borderA, borderB, computedMarginA, computedMarginB, computedStyle, dirA, dirB, marginA, marginB, paddingA, paddingB; - - if (isWindow(elem)) { - base = document.documentElement[{height: 'clientHeight', width: 'clientWidth'}[measure]]; - - return { - base: base, - padding: 0, - border: 0, - margin: 0 - }; - } - - // Start with offset property - [ - base, - dirA, - dirB - ] = { - width: [ - elem.offsetWidth, - 'Left', - 'Right' - ], - height: [ - elem.offsetHeight, - 'Top', - 'Bottom' - ] - }[measure]; - - computedStyle = getStyle(elem); - paddingA = convertToPx(elem, computedStyle['padding' + dirA]) || 0; - paddingB = convertToPx(elem, computedStyle['padding' + dirB]) || 0; - borderA = convertToPx(elem, computedStyle['border' + dirA + 'Width']) || 0; - borderB = convertToPx(elem, computedStyle['border' + dirB + 'Width']) || 0; - computedMarginA = computedStyle['margin' + dirA]; - computedMarginB = computedStyle['margin' + dirB]; - - // I do not care for width for now, so this hack is irrelevant - // if ( !supportsPercentMargin ) - // computedMarginA = hackPercentMargin( elem, computedStyle, computedMarginA ) - // computedMarginB = hackPercentMargin( elem, computedStyle, computedMarginB ) - marginA = convertToPx(elem, computedMarginA) || 0; - marginB = convertToPx(elem, computedMarginB) || 0; - - return { - base: base, - padding: paddingA + paddingB, - border: borderA + borderB, - margin: marginA + marginB - }; - } - - function getWidthHeight(elem, direction, measure) { - let computedStyle, result; - - let measurements = getMeasurements(elem, direction); - - if (measurements.base > 0) { - return { - base: measurements.base - measurements.padding - measurements.border, - outer: measurements.base, - outerfull: measurements.base + measurements.margin - }[measure]; - } - - // Fall back to computed then uncomputed css if necessary - computedStyle = getStyle(elem); - result = computedStyle[direction]; - - if (result < 0 || result === null) { - result = elem.style[direction] || 0; - } - - // Normalize "", auto, and prepare for extra - result = parseFloat(result) || 0; - - return { - base: result - measurements.padding - measurements.border, - outer: result, - outerfull: result + measurements.padding + measurements.border + measurements.margin - }[measure]; - } - - // define missing methods - return angular.forEach({ - before(newElem) { - var children, elem, i, j, parent, ref, self; - self = this; - elem = self[0]; - parent = self.parent(); - children = parent.contents(); - if (children[0] === elem) { - return parent.prepend(newElem); - } else { - for (i = j = 1, ref = children.length - 1; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { - if (children[i] === elem) { - angular.element(children[i - 1]).after(newElem); - return; - } - } - throw new Error('invalid DOM structure ' + elem.outerHTML); - } - }, - height (value){ - var self; - self = this; - if (angular.isDefined(value)) { - if (angular.isNumber(value)) { - value = value + 'px'; - } - return css.call(self, 'height', value); - } else { - return getWidthHeight(this[0], 'height', 'base'); - } - }, - outerHeight(option) { - return getWidthHeight(this[0], 'height', option ? 'outerfull' : 'outer'); - }, - outerWidth(option) { - return getWidthHeight(this[0], 'width', option ? 'outerfull' : 'outer'); - }, - - /* - The offset setter method is not implemented - */ - offset(value) { - let docElem, win; - let self = this; - let box = { - top: 0, - left: 0 - }; - let elem = self[0]; - let doc = elem && elem.ownerDocument; - - if (arguments.length) { - if (value === undefined) { - return self; - } - // TODO: implement setter - throw new Error('offset setter method is not implemented'); - } - - if (!doc) { - return; - } - - docElem = doc.documentElement; - - // TODO: Make sure it's not a disconnected DOM node - - if (elem.getBoundingClientRect != null) { - box = elem.getBoundingClientRect(); - } - - win = doc.defaultView || doc.parentWindow; - - return { - top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), - left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) - }; - }, - scrollTop(value) { - return scrollTo(this, 'top', value); - }, - scrollLeft(value) { - return scrollTo(this, 'left', value); - } - }, (value, key) => { - if (!element.prototype[key]) { - return element.prototype[key] = value; - } - }); - } - }; - } - ]) - .run([ - '$log', - '$window', - 'jqLiteExtras', - function (console, window, jqLiteExtras) { - if (!window.jQuery) { - return jqLiteExtras.registerFor(angular.element); - } - } - ]); diff --git a/test/jqliteExtrasSpec.js b/test/jqliteExtrasSpec.js index b49798c4..45045cdb 100644 --- a/test/jqliteExtrasSpec.js +++ b/test/jqliteExtrasSpec.js @@ -5,7 +5,7 @@ describe('\njqLite: testing against jQuery\n', function () { var extras; - beforeEach(module('ui.scroll.jqlite')); + beforeEach(module('ui.scroll')); beforeEach(function(){ angular.element(document).find('body').append(sandbox = angular.element('
')); inject(function(jqLiteExtras) { From ade38c964233d363e0263f3ce6a62da292575180 Mon Sep 17 00:00:00 2001 From: dhilt Date: Thu, 15 Dec 2016 03:46:38 +0300 Subject: [PATCH 3/4] fix demos --- demo/adapter/adapter.html | 13 +++---------- demo/adapter/adapter.js | 2 +- .../adapterOnController/adapterOnController.html | 1 - demo/adapterOnController/adapterOnController.js | 2 +- demo/animation/animation.html | 16 ++-------------- demo/animation/animation.js | 2 +- demo/append/append.html | 4 +--- demo/append/append.js | 2 +- demo/cache/cache.html | 1 - demo/cache/cache.js | 2 +- demo/chat/chat.html | 1 - demo/chat/chat.js | 2 +- demo/controllerAs/controllerAs.html | 7 ++----- demo/controllerAs/controllerAs.js | 2 +- .../differentItemHeights.html | 1 - .../differentItemHeights/differentItemHeights.js | 2 +- demo/disabled/disabled.html | 1 - demo/disabled/disabled.js | 2 +- demo/grid-dnd-sort-2/grid-dnd-sort.html | 1 - demo/grid-dnd-sort-2/grid-dnd-sort.js | 2 +- demo/grid-dnd-sort/grid-dnd-sort.html | 1 - demo/grid-dnd-sort/grid-dnd-sort.js | 2 +- demo/grid-dnd-widths/grid-dnd-widths.html | 1 - demo/grid-dnd-widths/grid-dnd-widths.js | 2 +- demo/grid-layout-apply/grid-layout-apply.html | 1 - demo/grid-layout-apply/grid-layout-apply.js | 2 +- .../grid-layout-manipulations.html | 1 - .../grid-layout-manipulations.js | 2 +- demo/insideComponent/insideComponent.html | 1 - demo/insideComponent/insideComponent.js | 2 +- demo/insideDirective/insideDirective.html | 1 - demo/insideDirective/insideDirective.js | 2 +- demo/isLoading/isLoading.html | 1 - demo/isLoading/isLoading.js | 2 +- demo/isLoading/isLoadingAdapter.html | 1 - demo/isLoading/isLoadingAdapter.js | 2 +- demo/listScroller/listScroller.html | 1 - demo/listScroller/listScroller.js | 2 +- demo/multipleLists/multipleLists.html | 1 - demo/multipleLists/multipleLists.js | 2 +- demo/multipleReloadTest/multipleReload.html | 1 - demo/multipleReloadTest/multipleReload.js | 2 +- demo/persistentScroll/persistentScroll.html | 1 - demo/persistentScroll/persistentScroll.js | 2 +- demo/positionedList/positionedList.html | 1 - demo/positionedList/positionedList.js | 2 +- demo/rebuilding/rebuilding.html | 1 - demo/rebuilding/rebuilding.js | 2 +- demo/reload100/reload100.html | 1 - demo/reload100/reload100.js | 2 +- demo/scopeDatasource/scopeDatasource.html | 1 - demo/scopeDatasource/scopeDatasource.js | 2 +- .../scrollBubblingPrevent.html | 1 - .../scrollBubblingPrevent.js | 2 +- demo/serviceDatasource/serviceDatasource.html | 1 - demo/serviceDatasource/serviceDatasource.js | 2 +- demo/tableScroller/tableScroller.html | 1 - demo/tableScroller/tableScroller.js | 2 +- demo/topVisible/topVisible.html | 1 - demo/topVisible/topVisible.js | 2 +- demo/topVisible/topVisibleAdapter.js | 2 +- demo/userIndexes/userIndexes.html | 1 - demo/userIndexes/userIndexes.js | 2 +- demo/visibility/visibility.html | 1 - demo/visibility/visibility.js | 2 +- demo/windowViewport/windowViewport-iframe.html | 1 - demo/windowViewport/windowViewport.html | 1 - demo/windowViewport/windowViewport.js | 2 +- .../windowviewportInline.html | 1 - .../windowviewportInline/windowviewportInline.js | 2 +- 70 files changed, 43 insertions(+), 98 deletions(-) diff --git a/demo/adapter/adapter.html b/demo/adapter/adapter.html index 1f445877..d8fc71ba 100644 --- a/demo/adapter/adapter.html +++ b/demo/adapter/adapter.html @@ -1,22 +1,15 @@ - + - Scroller Demo (adapter) + Adapter demo - - + - - - - - -
browse other examples

Adapter (updatable scroller)

diff --git a/demo/adapter/adapter.js b/demo/adapter/adapter.js index 62f57bed..673198bb 100644 --- a/demo/adapter/adapter.js +++ b/demo/adapter/adapter.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', [ +angular.module('application', ['ui.scroll']).controller('mainController', [ '$scope', '$log', '$timeout', function($scope, console, $timeout) { var datasource, idList1, idList2; datasource = {}; diff --git a/demo/adapterOnController/adapterOnController.html b/demo/adapterOnController/adapterOnController.html index fdaea4c5..524519fd 100644 --- a/demo/adapterOnController/adapterOnController.html +++ b/demo/adapterOnController/adapterOnController.html @@ -5,7 +5,6 @@ Adapter On Controller - diff --git a/demo/adapterOnController/adapterOnController.js b/demo/adapterOnController/adapterOnController.js index b70839e6..4be749cb 100644 --- a/demo/adapterOnController/adapterOnController.js +++ b/demo/adapterOnController/adapterOnController.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/animation/animation.html b/demo/animation/animation.html index e3ea8bd5..1a8c322f 100644 --- a/demo/animation/animation.html +++ b/demo/animation/animation.html @@ -1,16 +1,11 @@ - + - Scroller Demo (animation) - + Animation demo - - - - @@ -42,13 +37,6 @@

--> - - - - - - -
browse other examples

Animation demo

diff --git a/demo/animation/animation.js b/demo/animation/animation.js index dc4f10ad..56b2f1e7 100644 --- a/demo/animation/animation.js +++ b/demo/animation/animation.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ngAnimate']).controller('mainController', [ +angular.module('application', ['ui.scroll', 'ngAnimate']).controller('mainController', [ '$scope', '$log', '$timeout', function($scope, console, $timeout) { var datasource, idList; datasource = {}; diff --git a/demo/append/append.html b/demo/append/append.html index 57d7a442..974f1de4 100644 --- a/demo/append/append.html +++ b/demo/append/append.html @@ -5,7 +5,6 @@ Append and prepend - @@ -28,8 +27,7 @@

Append and prepend demo

appendItem(params) to add one new item (based on params) to the end of the remote data set,
  • - prependItem(params) to add one new item (based on params) in the beginning of the remote data - set, + prependItem(params) to add one new item (based on params) in the beginning of the remote data set,
  • request(index, count) just to fetch a bunch of items for the viewport. diff --git a/demo/append/append.js b/demo/append/append.js index 6ed53658..600972b5 100644 --- a/demo/append/append.js +++ b/demo/append/append.js @@ -1,4 +1,4 @@ -var app = angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']); +var app = angular.module('application', ['ui.scroll']); app.factory('Server', [ '$timeout', '$q', function ($timeout, $q) { diff --git a/demo/cache/cache.html b/demo/cache/cache.html index 79c277e3..23060c53 100644 --- a/demo/cache/cache.html +++ b/demo/cache/cache.html @@ -5,7 +5,6 @@ Scroller Demo (cache option) - diff --git a/demo/cache/cache.js b/demo/cache/cache.js index b0d35e6a..d79a6b88 100644 --- a/demo/cache/cache.js +++ b/demo/cache/cache.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', [ +angular.module('application', ['ui.scroll']).controller('mainController', [ '$scope', '$log', '$timeout', function($scope, console, $timeout) { var datasource = {}; diff --git a/demo/chat/chat.html b/demo/chat/chat.html index 7f561f19..2b6fd9eb 100644 --- a/demo/chat/chat.html +++ b/demo/chat/chat.html @@ -5,7 +5,6 @@ Chat demo - diff --git a/demo/chat/chat.js b/demo/chat/chat.js index bc1591ae..6433f25a 100644 --- a/demo/chat/chat.js +++ b/demo/chat/chat.js @@ -1,4 +1,4 @@ -var app = angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']); +var app = angular.module('application', ['ui.scroll']); app.factory('Server', [ '$timeout', '$q', function ($timeout, $q) { diff --git a/demo/controllerAs/controllerAs.html b/demo/controllerAs/controllerAs.html index a77597b3..a003747d 100644 --- a/demo/controllerAs/controllerAs.html +++ b/demo/controllerAs/controllerAs.html @@ -1,15 +1,12 @@ - + - Scroller Demo (controller as) + Controller as syntax - - - diff --git a/demo/controllerAs/controllerAs.js b/demo/controllerAs/controllerAs.js index d8b6f6b1..a18158a6 100644 --- a/demo/controllerAs/controllerAs.js +++ b/demo/controllerAs/controllerAs.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).controller('mainController', [ +angular.module('application', ['ui.scroll']).controller('mainController', [ '$timeout', function($timeout) { var datasource = {}; diff --git a/demo/differentItemHeights/differentItemHeights.html b/demo/differentItemHeights/differentItemHeights.html index 15dd906d..e0cb82fe 100644 --- a/demo/differentItemHeights/differentItemHeights.html +++ b/demo/differentItemHeights/differentItemHeights.html @@ -5,7 +5,6 @@ Different Item Heights - diff --git a/demo/differentItemHeights/differentItemHeights.js b/demo/differentItemHeights/differentItemHeights.js index c40d4160..2dce2c73 100644 --- a/demo/differentItemHeights/differentItemHeights.js +++ b/demo/differentItemHeights/differentItemHeights.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).factory('datasource', [ +angular.module('application', ['ui.scroll']).factory('datasource', [ '$log', '$timeout', function(console, $timeout) { var get, max, min; min = -50; diff --git a/demo/disabled/disabled.html b/demo/disabled/disabled.html index 4a28bd90..9c0bf8f1 100644 --- a/demo/disabled/disabled.html +++ b/demo/disabled/disabled.html @@ -5,7 +5,6 @@ Disabling - diff --git a/demo/disabled/disabled.js b/demo/disabled/disabled.js index 77c75d07..30219f1a 100644 --- a/demo/disabled/disabled.js +++ b/demo/disabled/disabled.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/grid-dnd-sort-2/grid-dnd-sort.html b/demo/grid-dnd-sort-2/grid-dnd-sort.html index c63f158b..1762c105 100644 --- a/demo/grid-dnd-sort-2/grid-dnd-sort.html +++ b/demo/grid-dnd-sort-2/grid-dnd-sort.html @@ -7,7 +7,6 @@ - diff --git a/demo/grid-dnd-sort-2/grid-dnd-sort.js b/demo/grid-dnd-sort-2/grid-dnd-sort.js index eca39cd5..b7b6d421 100644 --- a/demo/grid-dnd-sort-2/grid-dnd-sort.js +++ b/demo/grid-dnd-sort-2/grid-dnd-sort.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid', 'dnd']) +angular.module('application', ['ui.scroll', 'ui.scroll.grid', 'dnd']) .controller('gridController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/grid-dnd-sort/grid-dnd-sort.html b/demo/grid-dnd-sort/grid-dnd-sort.html index e5d86fb7..f5e971c4 100644 --- a/demo/grid-dnd-sort/grid-dnd-sort.html +++ b/demo/grid-dnd-sort/grid-dnd-sort.html @@ -6,7 +6,6 @@ - diff --git a/demo/grid-dnd-sort/grid-dnd-sort.js b/demo/grid-dnd-sort/grid-dnd-sort.js index 0e97103b..71f32f75 100644 --- a/demo/grid-dnd-sort/grid-dnd-sort.js +++ b/demo/grid-dnd-sort/grid-dnd-sort.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid']) +angular.module('application', ['ui.scroll', 'ui.scroll.grid']) .controller('gridController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/grid-dnd-widths/grid-dnd-widths.html b/demo/grid-dnd-widths/grid-dnd-widths.html index 944d67f9..f49c5442 100644 --- a/demo/grid-dnd-widths/grid-dnd-widths.html +++ b/demo/grid-dnd-widths/grid-dnd-widths.html @@ -6,7 +6,6 @@ - diff --git a/demo/grid-dnd-widths/grid-dnd-widths.js b/demo/grid-dnd-widths/grid-dnd-widths.js index eaa669cb..9404aeca 100644 --- a/demo/grid-dnd-widths/grid-dnd-widths.js +++ b/demo/grid-dnd-widths/grid-dnd-widths.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid']) +angular.module('application', ['ui.scroll', 'ui.scroll.grid']) .controller('gridController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/grid-layout-apply/grid-layout-apply.html b/demo/grid-layout-apply/grid-layout-apply.html index a45b6120..1792d2aa 100644 --- a/demo/grid-layout-apply/grid-layout-apply.html +++ b/demo/grid-layout-apply/grid-layout-apply.html @@ -6,7 +6,6 @@ - diff --git a/demo/grid-layout-apply/grid-layout-apply.js b/demo/grid-layout-apply/grid-layout-apply.js index b11fb1a2..11c13b2f 100644 --- a/demo/grid-layout-apply/grid-layout-apply.js +++ b/demo/grid-layout-apply/grid-layout-apply.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid']) +angular.module('application', ['ui.scroll', 'ui.scroll.grid']) .controller('gridController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/grid-layout-manipulations/grid-layout-manipulations.html b/demo/grid-layout-manipulations/grid-layout-manipulations.html index 64c33b4c..6535b5aa 100644 --- a/demo/grid-layout-manipulations/grid-layout-manipulations.html +++ b/demo/grid-layout-manipulations/grid-layout-manipulations.html @@ -6,7 +6,6 @@ - diff --git a/demo/grid-layout-manipulations/grid-layout-manipulations.js b/demo/grid-layout-manipulations/grid-layout-manipulations.js index d6ffd992..8a137feb 100644 --- a/demo/grid-layout-manipulations/grid-layout-manipulations.js +++ b/demo/grid-layout-manipulations/grid-layout-manipulations.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite', 'ui.scroll.grid']) +angular.module('application', ['ui.scroll', 'ui.scroll.grid']) .controller('gridController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/insideComponent/insideComponent.html b/demo/insideComponent/insideComponent.html index fbfa3195..51c71fc4 100644 --- a/demo/insideComponent/insideComponent.html +++ b/demo/insideComponent/insideComponent.html @@ -5,7 +5,6 @@ Inside es6 component - diff --git a/demo/insideComponent/insideComponent.js b/demo/insideComponent/insideComponent.js index 452fb58b..f6c6f856 100644 --- a/demo/insideComponent/insideComponent.js +++ b/demo/insideComponent/insideComponent.js @@ -29,7 +29,7 @@ } angular - .module('application', ['ui.scroll', 'ui.scroll.jqlite']) + .module('application', ['ui.scroll']) .component('myComponent', { controllerAs: 'ctrl', template: diff --git a/demo/insideDirective/insideDirective.html b/demo/insideDirective/insideDirective.html index 2b8c3f4f..27e6d5c6 100644 --- a/demo/insideDirective/insideDirective.html +++ b/demo/insideDirective/insideDirective.html @@ -5,7 +5,6 @@ Inside directive - diff --git a/demo/insideDirective/insideDirective.js b/demo/insideDirective/insideDirective.js index ce875900..35ec6953 100644 --- a/demo/insideDirective/insideDirective.js +++ b/demo/insideDirective/insideDirective.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', ['$scope', function($scope) { $scope.show = true; }]) diff --git a/demo/isLoading/isLoading.html b/demo/isLoading/isLoading.html index b90df852..4089f7e9 100644 --- a/demo/isLoading/isLoading.html +++ b/demo/isLoading/isLoading.html @@ -5,7 +5,6 @@ Is loading - diff --git a/demo/isLoading/isLoading.js b/demo/isLoading/isLoading.js index a8f8a939..6372d32d 100644 --- a/demo/isLoading/isLoading.js +++ b/demo/isLoading/isLoading.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .factory('datasource', ['$log', '$timeout', function (console, $timeout) { diff --git a/demo/isLoading/isLoadingAdapter.html b/demo/isLoading/isLoadingAdapter.html index 5f0ed696..68dcf14d 100644 --- a/demo/isLoading/isLoadingAdapter.html +++ b/demo/isLoading/isLoadingAdapter.html @@ -5,7 +5,6 @@ Is loading (Adapter) - diff --git a/demo/isLoading/isLoadingAdapter.js b/demo/isLoading/isLoadingAdapter.js index f14d040d..8f2e18f5 100644 --- a/demo/isLoading/isLoadingAdapter.js +++ b/demo/isLoading/isLoadingAdapter.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { diff --git a/demo/listScroller/listScroller.html b/demo/listScroller/listScroller.html index 7dd1ef68..0fbb7437 100644 --- a/demo/listScroller/listScroller.html +++ b/demo/listScroller/listScroller.html @@ -5,7 +5,6 @@ li based scrollable list - diff --git a/demo/listScroller/listScroller.js b/demo/listScroller/listScroller.js index a8f8a939..6372d32d 100644 --- a/demo/listScroller/listScroller.js +++ b/demo/listScroller/listScroller.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .factory('datasource', ['$log', '$timeout', function (console, $timeout) { diff --git a/demo/multipleLists/multipleLists.html b/demo/multipleLists/multipleLists.html index 2cf56273..4f7d5df0 100644 --- a/demo/multipleLists/multipleLists.html +++ b/demo/multipleLists/multipleLists.html @@ -5,7 +5,6 @@ Independent scrollable lists - diff --git a/demo/multipleLists/multipleLists.js b/demo/multipleLists/multipleLists.js index c2dd5ee9..612fa584 100644 --- a/demo/multipleLists/multipleLists.js +++ b/demo/multipleLists/multipleLists.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/multipleReloadTest/multipleReload.html b/demo/multipleReloadTest/multipleReload.html index 821bfd92..39175992 100644 --- a/demo/multipleReloadTest/multipleReload.html +++ b/demo/multipleReloadTest/multipleReload.html @@ -5,7 +5,6 @@ Multiple reload test - diff --git a/demo/multipleReloadTest/multipleReload.js b/demo/multipleReloadTest/multipleReload.js index e0f00c31..70950d03 100644 --- a/demo/multipleReloadTest/multipleReload.js +++ b/demo/multipleReloadTest/multipleReload.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/persistentScroll/persistentScroll.html b/demo/persistentScroll/persistentScroll.html index fd447120..a7904e72 100644 --- a/demo/persistentScroll/persistentScroll.html +++ b/demo/persistentScroll/persistentScroll.html @@ -5,7 +5,6 @@ Preserves the scroll position on refresh - diff --git a/demo/persistentScroll/persistentScroll.js b/demo/persistentScroll/persistentScroll.js index 830f91cf..14d0d5d7 100644 --- a/demo/persistentScroll/persistentScroll.js +++ b/demo/persistentScroll/persistentScroll.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .factory('datasource', [ '$log', '$timeout', '$rootScope', '$location', function (console, $timeout, $rootScope, $location) { diff --git a/demo/positionedList/positionedList.html b/demo/positionedList/positionedList.html index 1a09be26..993e141d 100644 --- a/demo/positionedList/positionedList.html +++ b/demo/positionedList/positionedList.html @@ -5,7 +5,6 @@ Scroller Demo (list based) - diff --git a/demo/positionedList/positionedList.js b/demo/positionedList/positionedList.js index d8686e4b..b350b67c 100644 --- a/demo/positionedList/positionedList.js +++ b/demo/positionedList/positionedList.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .factory('datasource', ['$log', '$timeout', '$rootScope', function (console, $timeout, $rootScope) { diff --git a/demo/rebuilding/rebuilding.html b/demo/rebuilding/rebuilding.html index 92b6ee21..91e831cd 100644 --- a/demo/rebuilding/rebuilding.html +++ b/demo/rebuilding/rebuilding.html @@ -5,7 +5,6 @@ Rebuilding - diff --git a/demo/rebuilding/rebuilding.js b/demo/rebuilding/rebuilding.js index 697ae294..ddada8cf 100644 --- a/demo/rebuilding/rebuilding.js +++ b/demo/rebuilding/rebuilding.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/reload100/reload100.html b/demo/reload100/reload100.html index 680616b0..2d3534ec 100644 --- a/demo/reload100/reload100.html +++ b/demo/reload100/reload100.html @@ -5,7 +5,6 @@ Reload 100 - diff --git a/demo/reload100/reload100.js b/demo/reload100/reload100.js index 0adb9af6..dd3977c9 100644 --- a/demo/reload100/reload100.js +++ b/demo/reload100/reload100.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/scopeDatasource/scopeDatasource.html b/demo/scopeDatasource/scopeDatasource.html index c0e0b98c..48513d2e 100644 --- a/demo/scopeDatasource/scopeDatasource.html +++ b/demo/scopeDatasource/scopeDatasource.html @@ -5,7 +5,6 @@ Datasource on scope (not as service) - diff --git a/demo/scopeDatasource/scopeDatasource.js b/demo/scopeDatasource/scopeDatasource.js index 520169f4..7c873bc8 100644 --- a/demo/scopeDatasource/scopeDatasource.js +++ b/demo/scopeDatasource/scopeDatasource.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { var datasource = {}; diff --git a/demo/scrollBubblingPrevent/scrollBubblingPrevent.html b/demo/scrollBubblingPrevent/scrollBubblingPrevent.html index b8ac38bf..594c24a1 100644 --- a/demo/scrollBubblingPrevent/scrollBubblingPrevent.html +++ b/demo/scrollBubblingPrevent/scrollBubblingPrevent.html @@ -5,7 +5,6 @@ Scroller Demo (scroll bubbles up only after eof/bof) - diff --git a/demo/scrollBubblingPrevent/scrollBubblingPrevent.js b/demo/scrollBubblingPrevent/scrollBubblingPrevent.js index d6ad0c88..a9216917 100644 --- a/demo/scrollBubblingPrevent/scrollBubblingPrevent.js +++ b/demo/scrollBubblingPrevent/scrollBubblingPrevent.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']).factory('datasource', [ +angular.module('application', ['ui.scroll']).factory('datasource', [ '$log', '$timeout', function(console, $timeout) { var get, max, min; min = -50; diff --git a/demo/serviceDatasource/serviceDatasource.html b/demo/serviceDatasource/serviceDatasource.html index 93203c6e..e0edb579 100644 --- a/demo/serviceDatasource/serviceDatasource.html +++ b/demo/serviceDatasource/serviceDatasource.html @@ -5,7 +5,6 @@ Datasource as service - diff --git a/demo/serviceDatasource/serviceDatasource.js b/demo/serviceDatasource/serviceDatasource.js index efdf0e50..b8eab711 100644 --- a/demo/serviceDatasource/serviceDatasource.js +++ b/demo/serviceDatasource/serviceDatasource.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .factory('datasource', ['$log', '$timeout', function (console, $timeout) { diff --git a/demo/tableScroller/tableScroller.html b/demo/tableScroller/tableScroller.html index 530681ce..8bf71353 100644 --- a/demo/tableScroller/tableScroller.html +++ b/demo/tableScroller/tableScroller.html @@ -5,7 +5,6 @@ Table based scrollable list - diff --git a/demo/tableScroller/tableScroller.js b/demo/tableScroller/tableScroller.js index efdf0e50..b8eab711 100644 --- a/demo/tableScroller/tableScroller.js +++ b/demo/tableScroller/tableScroller.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll']) .factory('datasource', ['$log', '$timeout', function (console, $timeout) { diff --git a/demo/topVisible/topVisible.html b/demo/topVisible/topVisible.html index 55c502d5..b9f954b6 100644 --- a/demo/topVisible/topVisible.html +++ b/demo/topVisible/topVisible.html @@ -5,7 +5,6 @@ Top visible - diff --git a/demo/topVisible/topVisible.js b/demo/topVisible/topVisible.js index a8f8a939..8f38b9e3 100644 --- a/demo/topVisible/topVisible.js +++ b/demo/topVisible/topVisible.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll',]) .factory('datasource', ['$log', '$timeout', function (console, $timeout) { diff --git a/demo/topVisible/topVisibleAdapter.js b/demo/topVisible/topVisibleAdapter.js index f14d040d..207cd481 100644 --- a/demo/topVisible/topVisibleAdapter.js +++ b/demo/topVisible/topVisibleAdapter.js @@ -1,4 +1,4 @@ -angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) +angular.module('application', ['ui.scroll',]) .controller('mainController', [ '$scope', '$log', '$timeout', function ($scope, console, $timeout) { diff --git a/demo/userIndexes/userIndexes.html b/demo/userIndexes/userIndexes.html index c0fb1001..f6dcdfdc 100644 --- a/demo/userIndexes/userIndexes.html +++ b/demo/userIndexes/userIndexes.html @@ -5,7 +5,6 @@ User min and max indexes -