Skip to content
This repository
Browse code

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
Sean Harvey authored April 11, 2012
2  code/model/RedirectorPage.php
@@ -118,7 +118,7 @@ function onBeforeWrite() {
118 118
 	}
119 119
 
120 120
 	function getCMSFields($params = null) {
121  
-		Requirements::javascript(SAPPHIRE_DIR . "/javascript/RedirectorPage.js");
  121
+		Requirements::javascript(CMS_DIR . '/javascript/RedirectorPage.js');
122 122
 		
123 123
 		$fields = parent::getCMSFields();
124 124
 		$fields->removeByName('Content', true);
24  javascript/RedirectorPage.js
... ...
@@ -0,0 +1,24 @@
  1
+(function($) {
  2
+	$.entwine('ss', function($){
  3
+		$('#Form_EditForm_RedirectionType input').entwine({
  4
+			onmatch: function() {
  5
+				var self = $(this);
  6
+				if(self.attr('checked')) this.toggle();
  7
+				this._super();
  8
+			},
  9
+			onclick: function() {
  10
+				this.toggle();
  11
+			},
  12
+			toggle: function() {
  13
+				if($(this).attr('value') == 'Internal') {
  14
+					$('#ExternalURL').hide();
  15
+					$('#LinkToID').show();
  16
+				} else {
  17
+					$('#ExternalURL').show();
  18
+					$('#LinkToID').hide();
  19
+				}
  20
+			}
  21
+		});
  22
+	});
  23
+})(jQuery);
  24
+

0 notes on commit 240627b

Please sign in to comment.
Something went wrong with that request. Please try again.