Don't allow saving to built in layouts

pull/2725/head
Isaac Connor 2019-06-20 13:48:14 -04:00
parent 71eadfc40e
commit d026c61077
1 changed files with 11 additions and 1 deletions

View File

@ -214,7 +214,6 @@ function selectLayout(element) {
if ( layout_id = parseInt(layout) ) {
layout = layouts[layout];
console.log(layout);
for ( var i = 0, length = monitors.length; i < length; i++ ) {
monitor = monitors[i];
@ -397,6 +396,17 @@ function edit_layout(button) {
function save_layout(button) {
var form = button.form;
var name = form.elements['Name'].value;
if ( !name )
name = form.elements['zmMontageLayout'].options[form.elements['zmMontageLayout'].selectedIndex].text;
console.log(name);
if ( name == 'Freeform' || name=='2 Wide' || name=='3 Wide' || name=='4 Wide' || name == '5 Wide' ) {
alert('You cannot edit the built in layouts. Please give the layout a new name.');
return;
}
// In fixed positioning, order doesn't matter. In floating positioning, it does.
var Positions = {};
for ( var i = 0, length = monitors.length; i < length; i++ ) {