Merge pull request #90 from halkyon/redirectorpage_changes

BUGFIX Adding RedirectorPage.js to cms module (was in sapphire) and swapping out old behaviour.js usage
This commit is contained in:
Stig Lindqvist 2012-04-11 04:10:01 -07:00
commit 587de186d0
2 changed files with 25 additions and 1 deletions

View File

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