silverstripe-betternavigator/javascript/BN.LeftAndMain.Preview.js

18 lines
627 B
JavaScript
Raw Normal View History

2014-08-13 02:41:18 +02:00
//Hide the navigator when we're in the CMS
//ToDo - should be easier to use afterIframeAdjustedForPreview() but I couldn't work out how to do this
2015-12-18 00:58:50 +01:00
(function($) {
$('.cms-preview').entwine({
onadd: function() {
var iframe = this.find('iframe');
if (iframe){
iframe.bind('load', function() {
var doc = this.contentDocument;
if(!doc) {return;}
var navi = doc.getElementById('BetterNavigator');
if(navi) {navi.style.display = 'none';}
});
}
}
});
2014-08-13 02:41:18 +02:00
}(jQuery));