Permalink
Browse files

ENHANCEMENT Removed jquery.livequery.js dependency in LeftAndMain, is…

… using jquery.concrete now. Moved only application of livequery (cms form buttons) to concrete

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92735 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 4aa80af commit 3124388b4d2a44ed66c900a80c273302baeaa460 @chillu chillu committed Nov 21, 2009
Showing with 34 additions and 29 deletions.
  1. +0 −1 code/LeftAndMain.php
  2. +2 −0 javascript/LeftAndMain.EditForm.js
  3. +32 −28 javascript/LeftAndMain.js
View
1 code/LeftAndMain.php
@@ -211,7 +211,6 @@ function init() {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TabSet.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
- Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-livequery/jquery.livequery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-cookie/jquery.cookie.js');
Requirements::javascript(CMS_DIR . '/thirdparty/jquery-notice/jquery.notice.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/jquery-ondemand/jquery.ondemand.js');
View
2 javascript/LeftAndMain.EditForm.js
@@ -300,6 +300,8 @@
// TODO Fix once concrete library is updated
this.bind('click', function(e) {return self.clickFake(e);});
+
+ this._super();
},
clickFake: function(e) {
$(this[0].form).concrete('ss').ajaxSubmit(this);
View
60 javascript/LeftAndMain.js
@@ -56,7 +56,6 @@ var ss_MainLayout;
$(window).unload(function(){ layoutState.save('ss_MainLayout');});
this._setupPinging();
- this._setupButtons();
this._resizeChildren();
// artificially delay the resize event 200ms
@@ -169,33 +168,6 @@ var ss_MainLayout;
},
/**
- * Make all buttons "hoverable" with jQuery theming.
- */
- _setupButtons: function() {
- // Initialize buttons
- this.find(':submit, button, :reset').livequery(function() {
- jQuery(this).addClass(
- 'ui-state-default ' +
- 'ui-corner-all'
- )
- .hover(
- function() {
- $(this).addClass('ui-state-hover');
- },
- function() {
- $(this).removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- $(this).addClass('ui-state-focus');
- })
- .blur(function() {
- $(this).removeClass('ui-state-focus');
- });
- });
- },
-
- /**
* Resize elements in center panel
* to fit the boundary box provided by the layout manager
*/
@@ -218,6 +190,38 @@ var ss_MainLayout;
});
/**
+ * @class Make all buttons "hoverable" with jQuery theming.
+ * @name ss.LeftAndMain.Buttons
+ */
+ $('.LeftAndMain :submit, .LeftAndMain button, .LeftAndMain :reset').concrete('ss', function($){
+ return/** @lends ss.LeftAndMain.Buttons */{
+ onmatch: function() {
+ console.debug(this);
+ this.addClass(
+ 'ui-state-default ' +
+ 'ui-corner-all'
+ )
+ .hover(
+ function() {
+ $(this).addClass('ui-state-hover');
+ },
+ function() {
+ $(this).removeClass('ui-state-hover');
+ }
+ )
+ .focus(function() {
+ $(this).addClass('ui-state-focus');
+ })
+ .blur(function() {
+ $(this).removeClass('ui-state-focus');
+ });
+
+ this._super();
+ }
+ };
+ });
+
+ /**
* @class Container for tree actions like "create", "search", etc.
* @name ss.TreeActions
*/

0 comments on commit 3124388

Please sign in to comment.