mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: convert ImageFormAction form prototype syntax to jQuery syntax, merged from r94304 (from r94332)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95596 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c817f45bb7
commit
1548eab100
@ -22,8 +22,8 @@ class ImageFormAction extends FormAction {
|
|||||||
parent::__construct($action, $title, $form);
|
parent::__construct($action, $title, $form);
|
||||||
}
|
}
|
||||||
function Field() {
|
function Field() {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
|
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
|
||||||
|
|
||||||
$classClause = '';
|
$classClause = '';
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
Behaviour.register({
|
(function($) {
|
||||||
'input.rollover' : {
|
$(document).ready(function() {
|
||||||
initialize: function() {
|
$("input.rollover").livequery(function(){
|
||||||
var srcParts = this.src.match( /(.*)\.([a-zA-Z]+)$/ );
|
var srcParts = jQuery(this).attr('src').match( /(.*)\.([a-zA-Z]+)$/ );
|
||||||
var fileName = srcParts[1];
|
var fileName = srcParts[1];
|
||||||
var extension = srcParts[2];
|
var extension = srcParts[2];
|
||||||
|
|
||||||
this.overSrc = fileName + '_over.' + extension;
|
this.overSrc = fileName + '_over.' + extension;
|
||||||
this.outSrc = this.src;
|
this.outSrc = jQuery(this).attr('src');
|
||||||
},
|
});
|
||||||
|
$("input.rollover").livequery('mouseover', function(){
|
||||||
|
jQuery(this).attr('src', this.overSrc);
|
||||||
|
});
|
||||||
|
|
||||||
onmouseover: function() {
|
$("input.rollover").livequery('mouseout', function(){
|
||||||
this.src = this.overSrc;
|
jQuery(this).attr('src', this.outSrc);
|
||||||
},
|
});
|
||||||
|
});
|
||||||
onmouseout: function() {
|
})(jQuery);
|
||||||
this.src = this.outSrc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user