Commit 58cef1c5 authored by alexeyomelchenko's avatar alexeyomelchenko
Browse files

Bug 1667466 fix static pages

behatnotneeded: same functionality

Change-Id: I0024eb1a506f1bbbc4a8fd1def37701a6ea0060d
parent 4a9e6f29
...@@ -46,8 +46,8 @@ function updateWYSIWYGText() { ...@@ -46,8 +46,8 @@ function updateWYSIWYGText() {
function updateSiteDefault(changed) { function updateSiteDefault(changed) {
changedCheckbox = (changed) ? true : false; changedCheckbox = (changed) ? true : false;
var editor = jQuery('#editsitepage_pagetext_container .mce-tinymce'); var editor = jQuery('#editsitepage_pagetext_container .mce-tinymce');
if (jQuery('#editsitepage_pageusedefault')[0] && $('editsitepage_pageusedefault').prop('checked') === true) { if (jQuery('#editsitepage_pageusedefault')[0] && jQuery('#editsitepage_pageusedefault').prop('checked') === true) {
jQuery(tinyMCE.activeEditor.getBody()).prop('contenteditable', false); tinyMCE.activeEditor.getBody().setAttribute('contenteditable', false);
jQuery('#changecheckboxdiv').css({ jQuery('#changecheckboxdiv').css({
'display': 'block', 'display': 'block',
'zIndex': '1', 'zIndex': '1',
...@@ -59,12 +59,12 @@ function updateSiteDefault(changed) { ...@@ -59,12 +59,12 @@ function updateSiteDefault(changed) {
}); });
} }
else { else {
jQuery(tinyMCE.activeEditor.getBody()).prop('contenteditable', true); tinyMCE.activeEditor.getBody().setAttribute('contenteditable', true);
jQuery('#changecheckboxdiv').css({ jQuery('#changecheckboxdiv').css({
'display': 'none', 'display': 'none',
'width': '1px', 'width': '1px',
'height': '1px' 'height': '1px'
}); });
} }
} }
...@@ -95,7 +95,7 @@ function contentSaved(form, data) { ...@@ -95,7 +95,7 @@ function contentSaved(form, data) {
updateSiteDefault(false); updateSiteDefault(false);
} }
jQuery.ready(function() { jQuery(window).load(function() {
connectElements(); connectElements();
// need to wait until tinyMCE editor is loaded before updating editor's text // need to wait until tinyMCE editor is loaded before updating editor's text
var checkExists = setInterval(function() { var checkExists = setInterval(function() {
......
...@@ -127,7 +127,8 @@ var PieformManager = (function($) { ...@@ -127,7 +127,8 @@ var PieformManager = (function($) {
'onreply' : [] // when a response is received 'onreply' : [] // when a response is received
}; };
$(document).ready(self.init); $(window).load(self.init);
}; };
}(jQuery)); }(jQuery));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment