mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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:
commit
587de186d0
@ -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);
|
||||
|
24
javascript/RedirectorPage.js
Normal file
24
javascript/RedirectorPage.js
Normal 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);
|
||||
|
Loading…
Reference in New Issue
Block a user