Commit e7f6c49d authored by Sven Franck's avatar Sven Franck

app: fixed wrong icon setting on input buttons

parent c2fb1dd4
......@@ -350,7 +350,7 @@
case "submit":
case "reset":
if (icon) {
icon_string = factory.util.classes(spec, icon);
icon_string = factory.util.classes(spec, icon, true);
}
container_class_list += "ui-btn ui-input-btn " + icon_string;
need_text_node = true;
......@@ -2683,19 +2683,21 @@
* util.classes
* @param {object} element Configuration
* @param {string} default_icon Icon to pass as default
* @param {string} pass Allow to pass through manually (input-wrapper eg)
* @return {string} finished class string
**/
factory.util.classes = function (element, default_icon) {
factory.util.classes = function (element, default_icon, pass) {
var def, string, iconpos, icon;
string = "";
// NOTE: we only set on <a>
// TODO: find a better way than to run everything through here...!
if (element.type === "a" ||
(element.attributes && element.attributes.type === "submit")) {
// NOTE: we only set on <a> NOT on INPUTs, because they are wrappped!
if (element.type === "a" || pass) {
icon = (element.attributes || {})["data-icon"] || default_icon;
// because of custom a in service_instance_status!
// because of custom a in service_instance_status
// NOTE: input buttons may need icons, but not ui-btn ui-shadow
// TODO: this has nothing to do here!!!
if (!(element.logic || {}).plain_link) {
string += " ui-btn ui-shadow ";
}
......
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