mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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:
parent
bc4208097f
commit
240627b504
@ -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