loleaflet: add parameter to disable 'About' menu
Change-Id: I07fa655b8318f78d7e479a3dc34830ebe5f81a2e
This commit is contained in:
parent
05deed08b4
commit
5d22b274f8
3 changed files with 9 additions and 1 deletions
|
@ -106,6 +106,7 @@
|
||||||
var permission = getParameterByName('permission') || 'edit';
|
var permission = getParameterByName('permission') || 'edit';
|
||||||
var timestamp = getParameterByName('timestamp');
|
var timestamp = getParameterByName('timestamp');
|
||||||
var closebutton = getParameterByName('closebutton');
|
var closebutton = getParameterByName('closebutton');
|
||||||
|
var disableAbout = getParameterByName('disableabout');
|
||||||
if (wopiSrc === '' && filePath === '') {
|
if (wopiSrc === '' && filePath === '') {
|
||||||
vex.dialog.alert(wrongwopisrc);
|
vex.dialog.alert(wrongwopisrc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,8 @@ var closebutton = getParameterByName('closebutton');
|
||||||
var revHistoryEnabled = getParameterByName('revisionhistory');
|
var revHistoryEnabled = getParameterByName('revisionhistory');
|
||||||
// Should the document go inactive or not
|
// Should the document go inactive or not
|
||||||
var alwaysActive = getParameterByName('alwaysactive');
|
var alwaysActive = getParameterByName('alwaysactive');
|
||||||
|
// Disable the about dialog
|
||||||
|
var disableAbout = getParameterByName('disableabout');
|
||||||
// Loleaflet Debug mode
|
// Loleaflet Debug mode
|
||||||
var debugMode = getParameterByName('debug');
|
var debugMode = getParameterByName('debug');
|
||||||
if (wopiSrc === '' && filePath === '') {
|
if (wopiSrc === '' && filePath === '') {
|
||||||
|
@ -88,6 +90,7 @@ if (host === '') {
|
||||||
// TODO: Get rid of these globals
|
// TODO: Get rid of these globals
|
||||||
global.closebutton = closebutton;
|
global.closebutton = closebutton;
|
||||||
global.revHistoryEnabled = revHistoryEnabled;
|
global.revHistoryEnabled = revHistoryEnabled;
|
||||||
|
global.disableAbout = disableAbout;
|
||||||
global.title = title;
|
global.title = title;
|
||||||
global.errorMessages = errorMessages;
|
global.errorMessages = errorMessages;
|
||||||
var docURL, docParams;
|
var docURL, docParams;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Control.Menubar
|
* Control.Menubar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global $ _ map title vex revHistoryEnabled closebutton */
|
/* global $ _ map title vex revHistoryEnabled closebutton disableAbout*/
|
||||||
L.Control.Menubar = L.Control.extend({
|
L.Control.Menubar = L.Control.extend({
|
||||||
// TODO: Some mechanism to stop the need to copy duplicate menus (eg. Help)
|
// TODO: Some mechanism to stop the need to copy duplicate menus (eg. Help)
|
||||||
options: {
|
options: {
|
||||||
|
@ -541,6 +541,10 @@ L.Control.Menubar = L.Control.extend({
|
||||||
_createMenu: function(menu) {
|
_createMenu: function(menu) {
|
||||||
var itemList = [];
|
var itemList = [];
|
||||||
for (var i in menu) {
|
for (var i in menu) {
|
||||||
|
if (menu[i].id === 'help' && disableAbout) {
|
||||||
|
menu[i].menu.pop();
|
||||||
|
}
|
||||||
|
|
||||||
if (map._permission === 'readonly' && menu[i].type === 'menu') {
|
if (map._permission === 'readonly' && menu[i].type === 'menu') {
|
||||||
var found = false;
|
var found = false;
|
||||||
for (var j in this.options.allowedReadonlyMenus) {
|
for (var j in this.options.allowedReadonlyMenus) {
|
||||||
|
|
Loading…
Reference in a new issue