From b75483e1dab999ca8500e027a5a3f54edae9a104 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Fri, 11 May 2012 17:37:31 +1200 Subject: [PATCH 1/2] BUGFIX: add missing _super calls to all matchers and unmatchers Otherwise some matchers might not be triggered as expected. --- javascript/AssetAdmin.js | 39 +++++++++++++++++----------------- javascript/CMSMain.AddForm.js | 3 ++- javascript/ReportAdmin.Tree.js | 5 ++++- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index 43a0ff78c7..2c78a4c374 100644 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -3,26 +3,25 @@ */ (function($) { - /** - * Delete selected folders through "batch actions" tab. - */ - $(document).ready(function() { - $('#Form_BatchActionsForm').entwine('ss').register( - // TODO Hardcoding of base URL - 'admin/assets/batchactions/delete', - function(ids) { - var confirmed = confirm( - ss.i18n.sprintf( - ss.i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'), - ids.length - ) - ); - return (confirmed) ? ids : false; - } - ); - }); - $.entwine('ss', function($){ + /** + * Delete selected folders through "batch actions" tab. + */ + $(document).ready(function() { + $('#Form_BatchActionsForm').register( + // TODO Hardcoding of base URL + 'admin/assets/batchactions/delete', + function(ids) { + var confirmed = confirm( + ss.i18n.sprintf( + ss.i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'), + ids.length + ) + ); + return (confirmed) ? ids : false; + } + ); + }); /** * Load folder detail view via controller methods @@ -120,4 +119,4 @@ } }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/javascript/CMSMain.AddForm.js b/javascript/CMSMain.AddForm.js index 2a63ebbad6..b466627b85 100644 --- a/javascript/CMSMain.AddForm.js +++ b/javascript/CMSMain.AddForm.js @@ -46,6 +46,7 @@ self.updateTypeList(); }); this.updateTypeList(); + this._super(); }, /** @@ -106,4 +107,4 @@ } }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/javascript/ReportAdmin.Tree.js b/javascript/ReportAdmin.Tree.js index e9350673b1..53b5aec271 100644 --- a/javascript/ReportAdmin.Tree.js +++ b/javascript/ReportAdmin.Tree.js @@ -14,8 +14,11 @@ var id = $('.cms-edit-form :input[name=ID]').val(); if (id) this[0].setCurrentByIdx(id); + this._super(); + }, + onunmatch: function() { this._super(); } }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); From aaeebd6ea2a0c0034edb5b80e37b56e979781236 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Fri, 18 May 2012 12:09:47 +1200 Subject: [PATCH 2/2] BUGFIX: change namespace for the tree so all matchers are executed Refer to similar commit on framework (55cabd6fbfe5c2f90f0825ed2a51098dc9a2f5ac) --- javascript/CMSMain.Tree.js | 10 +++++----- javascript/ReportAdmin.Tree.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/javascript/CMSMain.Tree.js b/javascript/CMSMain.Tree.js index 7fd4630422..0ba83ffe25 100644 --- a/javascript/CMSMain.Tree.js +++ b/javascript/CMSMain.Tree.js @@ -1,6 +1,6 @@ (function($) { - $.entwine('ss', function($){ + $.entwine('ss.tree', function($){ $('.cms-tree').entwine({ getTreeConfig: function() { var self = this, config = this._super(), hints = this.getHints(); @@ -18,7 +18,7 @@ 'label': '' + val.ssname, '_class': 'class-' + val.pagetype, 'action': function(obj) { - $('.cms-container').loadPanel(ss.i18n.sprintf( + $('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf( self.data('urlAddpage'), id, val.pagetype )); } @@ -30,7 +30,7 @@ 'edit': { 'label': ss.i18n._t('Tree.EditPage'), 'action': function(obj) { - $('.cms-container').loadPanel(ss.i18n.sprintf( + $('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf( self.data('urlEditpage'), obj.data('id') )); } @@ -41,7 +41,7 @@ menuitems['addsubpage'] = { 'label': ss.i18n._t('Tree.AddSubPage'), 'action': function(obj) { - $('.cms-container').loadPanel(ss.i18n.sprintf( + $('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf( self.data('urlAddpage'), id, 'Page' )); }, @@ -56,4 +56,4 @@ }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/javascript/ReportAdmin.Tree.js b/javascript/ReportAdmin.Tree.js index 53b5aec271..a7a93aef79 100644 --- a/javascript/ReportAdmin.Tree.js +++ b/javascript/ReportAdmin.Tree.js @@ -2,7 +2,7 @@ * File: ReportAdmin.Tree.js */ (function($) { - $.entwine('ss', function($){ + $.entwine('ss.tree', function($){ /** * Class: .cms-tree *