Commit a3355b08 authored by Sven Franck's avatar Sven Franck

renamed iconString generator

parent 15403d64
......@@ -1463,7 +1463,7 @@
* @param {string} portal type
* @param {string} identifier
**/
"download": function () {
"download": function (obj) {
util.error("Download: Not implemented.");
},
......@@ -2732,6 +2732,30 @@
/* ********************************************************************** */
factory.util = {};
/**
* Generate a string for icon and iconpos on any JQM element
* util.iconClasses
* @param {object} element Configuration
* @param {string} default_icon Icon to pass as default
* @return {string} finished class snippet
*/
factory.util.iconClasses = function (element, default_icon) {
var def,
string = "",
iconpos = element.attributes["data-iconpos"],
icon = element.attributes["data-icon"] || default_icon;
if (icon) {
string += " ui-icon-" + icon.replace("data-", "");
if (iconpos) {
def = iconpos.replace("data-", "");
}
string += " ui-btn-icon-" + (def || "left");
}
return string;
};
/**
* Generate an action menu (controlgroup)
* @actionMenu
......@@ -3373,7 +3397,7 @@
element.direct.className = (element.direct.className || "") +
order + (element.type === "a" ? (" ui-btn ui-shadow " +
factory.generateIconClassString(element)) : " ");
factory.util.iconClasses(element)) : " ");
}
// add state
......@@ -3476,11 +3500,6 @@
target.appendChild(closer);
}
// class string
if (element.type === "a") {
element.direct.className += " ui-btn";
}
target.appendChild(app.setContent(element));
panel.appendChild(target);
}
......@@ -3560,7 +3579,7 @@
element.direct.className = (element.direct.className || "") +
order + (element.type === "a" ? (" ui-btn ui-shadow " +
factory.generateIconClassString(element)) : " ");
factory.util.iconClasses(element)) : " ");
}
}
footer.appendChild(app.setContent(element));
......@@ -3915,7 +3934,7 @@
element.direct.className = (element.direct.className || "") +
order + (element.type === "a" ? (" ui-btn ui-shadow " +
factory.generateIconClassString(element)) : " ");
factory.util.iconClasses(element)) : " ");
}
if (state) {
......@@ -4001,7 +4020,7 @@
element.direct.className = (element.direct.className || "") +
order + (element.type === "a" ? (" ui-btn ui-shadow " +
factory.generateIconClassString(element)) : " ");
factory.util.iconClasses(element)) : " ");
}
target.appendChild(app.setContent(element));
......@@ -5035,7 +5054,7 @@
config.attributes["data-cacheval"] = true;
break;
case "checkbox":
icon_string = factory.generateIconClassString(config, "checkbox");
icon_string = factory.util.iconClasses(config, "checkbox");
container_class_list = "ui-" + config.attributes.type;
label_inside = true;
label_class_list = "ui-btn ui-corner-all ui-btn-inherit " +
......@@ -5046,7 +5065,7 @@
case "submit":
case "reset":
if (icon) {
icon_string = factory.generateIconClassString(config, icon);
icon_string = factory.util.iconClasses(config, icon);
}
container_class_list = "ui-btn ui-input-btn " + icon_string;
need_text_node = true;
......@@ -5089,7 +5108,7 @@
// select
if (config.type === "select") {
icon_string = factory.generateIconClassString(config);
icon_string = factory.util.iconClasses(config);
container_class_list = "ui-" + config.type;
element_target = factory.element(
"div",
......@@ -5346,34 +5365,6 @@
return element;
};
/* ********************************************************************** */
/* Class String Generator */
/* ********************************************************************** */
/**
* Generate a string for icon and iconpos on any JQM element
* generateIconClassString
* @param {object} element Configuration
* @param {string} default_icon Icon to pass as default
* @return {string} finished class snippet
*/
factory.generateIconClassString = function (element, default_icon) {
var def,
string = "",
iconpos = element.attributes["data-iconpos"],
icon = element.attributes["data-icon"] || default_icon;
if (icon) {
string += " ui-icon-" + icon.replace("data-", "");
if (iconpos) {
def = iconpos.replace("data-", "");
}
string += " ui-btn-icon-" + (def || "left");
}
return string;
};
/* ====================================================================== */
/* STORAGE */
/* ====================================================================== */
......@@ -7543,7 +7534,7 @@
convert = "values";
}
console.log(parcel.query)
return storage[parcel.storage][method || "allDocs"](parcel.query, hacked_view)
.then(function (response) {
// TODO: best way?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment