vendor/assets/javascripts/extensions/bootstrap-table-angular.js in bootstrap-table-rails-1.10.1 vs vendor/assets/javascripts/extensions/bootstrap-table-angular.js in bootstrap-table-rails-1.11.0

- old
+ new

@@ -1,15 +1,17 @@ // JavaScript source code (function () { if (typeof angular === 'undefined') { return; } - angular.module('bsTable', []).directive('bsTableControl', function () { + angular.module('bsTable', []) + .constant('uiBsTables', {bsTables: {}}) + .directive('bsTableControl', ['uiBsTables', function (uiBsTables) { var CONTAINER_SELECTOR = '.bootstrap-table'; var SCROLLABLE_SELECTOR = '.fixed-table-body'; var SEARCH_SELECTOR = '.search input'; - var bsTables = {}; + var bsTables = uiBsTables.bsTables; function getBsTable (el) { var result; $.each(bsTables, function (id, bsTable) { if (!bsTable.$el.closest(CONTAINER_SELECTOR).has(el).length) return; result = bsTable; @@ -99,7 +101,7 @@ $s.$on('$destroy', function () { delete bsTables[$s.$id]; }); } }; - }) + }]) })();