commit 230f5f4c19815498fedb1cdc1242cb2a5894fe80
parent b9a0b709eddaa7e603045812b7b455f96e0d76cb
Author: markseu <mark2011@mayberg.se>
Date: Mon, 26 Oct 2015 15:20:25 +0100
Core update (better IOS support)
Diffstat:
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/system/plugins/webinterface.js b/system/plugins/webinterface.js
@@ -222,7 +222,11 @@ yellow.webinterface =
{
if(yellow.debug) console.log("yellow.webinterface.showPane id:"+paneId);
element.style.display = "block";
- if(modal) yellow.toolbox.addClass(document.body, "yellow-body-modal-open");
+ if(modal)
+ {
+ yellow.toolbox.addClass(document.body, "yellow-body-modal-open");
+ yellow.toolbox.addValue("meta[name=viewport]", "content", ", maximum-scale=1, user-scalable=0");
+ }
this.paneId = paneId;
this.paneType = paneType;
this.resizePanes();
@@ -237,8 +241,9 @@ yellow.webinterface =
if(yellow.toolbox.isVisible(element))
{
if(yellow.debug) console.log("yellow.webinterface.hidePane id:"+paneId);
- element.style.display = "none";
yellow.toolbox.removeClass(document.body, "yellow-body-modal-open");
+ yellow.toolbox.removeValue("meta[name=viewport]", "content", ", maximum-scale=1, user-scalable=0");
+ element.style.display = "none";
this.paneId = 0;
this.paneType = 0;
}
@@ -374,7 +379,21 @@ yellow.toolbox =
var string = (" " + element.className + " ").replace(" " + name + " ", " ");
element.className = string.replace(/^\s+|\s+$/, "");
},
+
+ // Add attribute information
+ addValue: function(selector, name, value)
+ {
+ var element = document.querySelector(selector);
+ element.setAttribute(name, element.getAttribute(name) + value);
+ },
+ // Remove attribute information
+ removeValue: function(selector, name, value)
+ {
+ var element = document.querySelector(selector);
+ element.setAttribute(name, element.getAttribute(name).replace(value, ""));
+ },
+
// Add event handler
addEvent: function(element, type, handler)
{