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
This commit is contained in:
Ingo Schommer 2009-11-21 03:16:18 +00:00
parent 4aa80af647
commit 3124388b4d
3 changed files with 34 additions and 29 deletions

View File

@ -211,7 +211,6 @@ class LeftAndMain extends Controller {
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 File

@ -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 File

@ -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
@ -168,33 +167,6 @@ var ss_MainLayout;
}, this.PingIntervalSeconds() * 1000);
},
/**
* 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
@ -217,6 +189,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