BUGFIX Adding RedirectorPage.js to cms module (was in sapphire) and

fixing to use entwine/jquery instead of old behaviour
This commit is contained in:
Sean Harvey 2012-04-11 15:32:41 +12:00
parent bc4208097f
commit 240627b504
2 changed files with 25 additions and 1 deletions

View File

@ -118,7 +118,7 @@ class RedirectorPage extends Page {
}
function getCMSFields($params = null) {
Requirements::javascript(SAPPHIRE_DIR . "/javascript/RedirectorPage.js");
Requirements::javascript(CMS_DIR . '/javascript/RedirectorPage.js');
$fields = parent::getCMSFields();
$fields->removeByName('Content', true);

View File

@ -0,0 +1,24 @@
(function($) {
$.entwine('ss', function($){
$('#Form_EditForm_RedirectionType input').entwine({
onmatch: function() {
var self = $(this);
if(self.attr('checked')) this.toggle();
this._super();
},
onclick: function() {
this.toggle();
},
toggle: function() {
if($(this).attr('value') == 'Internal') {
$('#ExternalURL').hide();
$('#LinkToID').show();
} else {
$('#ExternalURL').show();
$('#LinkToID').hide();
}
}
});
});
})(jQuery);