Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

fixing to use entwine/jquery instead of old behaviour
  • Loading branch information...
commit 240627b504833493af81bbf884159a4596cadae2 1 parent bc42080
@halkyon halkyon authored
Showing with 25 additions and 1 deletion.
  1. +1 −1  code/model/RedirectorPage.php
  2. +24 −0 javascript/RedirectorPage.js
View
2  code/model/RedirectorPage.php
@@ -118,7 +118,7 @@ function onBeforeWrite() {
}
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
24 javascript/RedirectorPage.js
@@ -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);
+
Please sign in to comment.
Something went wrong with that request. Please try again.