Commit 579284d3 authored by Sven Franck's avatar Sven Franck

started check/checkallvisible/checkall

parent d9696888
......@@ -139,6 +139,48 @@
init.sort(e, "desc_abc", "sort", "sort-by-alphabet-alt");
break;
}
},
/**
* selecting single checkbox
* @method sort
* @param {object} e Event
*/
check: function (e) {
},
/**
* select all rows
* @method sort
* @param {object} e Event
*/
check_all: function (e) {
// // check all 3-state (none|all visible|all)
// if (config.checkbox.show) {
// $parent.on("change", ".tick_all", function (e) {
// var checkbox = e.target,
// label = checkbox.previousSibling;
//
// if (checkbox.checked) {
// if (checkbox.indeterminate === false) {
// checkbox.setAttribute("flag", true);
// }
// } else {
// if (checkbox.getAttribute("flag")) {
// checkbox.removeAttribute("flag");
// checkbox.indeterminate = true;
// checkbox.checked = true;
// label.className = label.className.replace(priv.filterForClass("ui-icon-checkbox-on"), ' ui-icon-globe');
// e.preventDefault();
// return false;
// } else {
// checkbox.indeterminate = false;
// label.className = label.className.replace(priv.filterForClass("ui-icon-globe") , '');
// }
// }
// });
// }
}
};
......@@ -389,14 +431,15 @@
config = {
"type":"input",
"direct": {
"id": settings.portal_type_title + "_tick_all",
"id": settings.portal_type_title + "_check_all",
"className": "action"
},
"attributes": {
"type": "checkbox",
"value": "Select All/Unselect All",
"data-iconpos":"notext",
"data-reference":"select_all"
"data-reference": settings.base_element.direct.id,
"data-action":"check_all"
},
"logic": {}
}
......@@ -520,7 +563,8 @@
"type": "checkbox",
"value": "Select " + item.title || item.id,
"data-iconpos":"notext",
"data-reference":"select_item"
"data-action":"check",
"data-reference": item.id
},
"logic": {}
},
......@@ -1861,40 +1905,6 @@
// }
// }
//
// // check all 3-state (none|all visible|all)
// if (config.checkbox.show) {
// $parent.on("change", ".tick_all", function (e) {
// var checkbox = e.target,
// label = checkbox.previousSibling;
//
// if (checkbox.checked) {
// if (checkbox.indeterminate === false) {
// checkbox.setAttribute("flag", true);
// }
// } else {
// if (checkbox.getAttribute("flag")) {
// checkbox.removeAttribute("flag");
// checkbox.indeterminate = true;
// checkbox.checked = true;
// label.className = label.className.replace(priv.filterForClass("ui-icon-checkbox-on"), ' ui-icon-globe');
// e.preventDefault();
// return false;
// } else {
// checkbox.indeterminate = false;
// label.className = label.className.replace(priv.filterForClass("ui-icon-globe") , '');
// }
// }
// });
// }
//
// });
......@@ -2718,22 +2728,33 @@
// global actions
.on("click change", ".action", function (e) {
var action, handler, test, target, href, element, form, valid, val;
var action,
handler,
test,
target,
href,
element,
form,
valid,
val,
tag;
tag = e.target.tagName;
// stop links triggering
if (e.type === "click") {
e.preventDefault();
if (e.type === "click" && e.target.tagName === "SELECT") {
if (e.type === "click" && tag === "SELECT") {
return;
}
}
if (e.type === "change") {
if (e.type === "change" && tag === "SELECT") {
val = e.target.options[e.target.selectedIndex].value;
}
// JQM bug on selects
// TODO: remove once fixed
if (e.target.tagName === "SPAN" || e.target.tagName === "OPTION") {
if (tag === "SPAN" || tag === "OPTION") {
return;
}
// map
......
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