diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-16 04:41:21 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-16 04:41:36 +0400 |
commit | d5d6c9e0a9b7c94ae7e5df3404e8da53608049e9 (patch) | |
tree | 0ab537ffe9b23d1556711e0e38ccbdb674134c52 /plugins/Actions | |
parent | ed213bd7405e4c95420324a9f37239d3d2349a7a (diff) |
Refs #4041, use require() and UIControl in all DataTable JS classes.
Diffstat (limited to 'plugins/Actions')
-rw-r--r-- | plugins/Actions/javascripts/actionsDataTable.js | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/plugins/Actions/javascripts/actionsDataTable.js b/plugins/Actions/javascripts/actionsDataTable.js index eb9d4dcc76..273d66a7d3 100644 --- a/plugins/Actions/javascripts/actionsDataTable.js +++ b/plugins/Actions/javascripts/actionsDataTable.js @@ -7,10 +7,11 @@ (function ($, require) { - var dataTable = window.dataTable, - dataTablePrototype = dataTable.prototype; + var exports = require('piwik/UI'), + DataTable = exports.DataTable, + dataTablePrototype = DataTable.prototype; - // helper function for actionDataTable + // helper function for ActionDataTable function getLevelFromClass(style) { if (!style || typeof style == "undefined") return 0; @@ -23,12 +24,12 @@ return currentLevel; } - // helper function for actionDataTable + // helper function for ActionDataTable function setImageMinus(domElem) { $('img.plusMinus', domElem).attr('src', 'plugins/Zeitgeist/images/minus.png'); } - // helper function for actionDataTable + // helper function for ActionDataTable function setImagePlus(domElem) { $('img.plusMinus', domElem).attr('src', 'plugins/Zeitgeist/images/plus.png'); } @@ -38,28 +39,22 @@ * * @constructor */ - window.ActionsDataTable = function () { - dataTable.call(this); + exports.ActionsDataTable = function (element) { + DataTable.call(this, element); this.parentAttributeParent = ''; this.parentId = ''; this.disabledRowDom = {}; // to handle double click on '+' row }; - $.extend(window.ActionsDataTable.prototype, dataTablePrototype, { + $.extend(exports.ActionsDataTable.prototype, dataTablePrototype, { //initialisation of the actionDataTable - init: function (workingDivId, domElem) { - if (typeof domElem == "undefined" - || domElem.length == 0) // needed for actions subtables where truncating was not working otherwise - { - domElem = $('#' + workingDivId); - } - this.workingDivId = workingDivId; + init: function () { + var domElem = this.$element; + this.workingDivId = this.$element.attr('id'); this.bindEventsAndApplyStyle(domElem); this.initialized = true; - - domElem.data('piwikDataTable', this); }, //see dataTable::bindEventsAndApplyStyle |