mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-09-06 01:31:09 +02:00
Introduces a preview window that appears when the screen is wide enough, removes old preview button, adds a draft-public switch, adds variety of preview options which are not hooked up yet. Relies on sapphire's f95fadc84416835302fe6c8448054960b5e7ec65
30 lines
772 B
JavaScript
30 lines
772 B
JavaScript
function windowName(suffix) {
|
|
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
|
return base + suffix;
|
|
}
|
|
|
|
(function($) {
|
|
$(document).ready(function() {
|
|
$('#switchView a.newWindow').on('click', function(e) {
|
|
var w = window.open(this.href, windowName(this.target));
|
|
w.focus();
|
|
return false;
|
|
});
|
|
|
|
$('#SilverStripeNavigatorLink').on('click', function(e) {
|
|
$('#SilverStripeNavigatorLinkPopup').toggle();
|
|
return false;
|
|
});
|
|
|
|
$('#SilverStripeNavigatorLinkPopup a.close').on('click', function(e) {
|
|
$('#SilverStripeNavigatorLinkPopup').hide();
|
|
return false;
|
|
});
|
|
|
|
$('#SilverStripeNavigatorLinkPopup input').on('focus',function(e) {
|
|
this.select();
|
|
});
|
|
});
|
|
|
|
})(jQuery);
|