Commit 228a98ef authored by Sven Franck's avatar Sven Franck

app: add new classList method (not used yet)

parent b6fc9c68
......@@ -5764,6 +5764,22 @@
return new RegExp("(?:^|\\s)" + className + "(?!\\S)", "g");
};
// /**
// * Property to set whether classlist is supported
// * @property support_classList
// */
// // TODO: add to support module/Modernizr
// util.no_support_classList = document.documentElement.classList === undefined;
//
// util.testForString = util.no_support_classList ?
// function(el, clss) {
// return el.className && new RegExp("(^|\\s)" +
// clss + "(\\s|$)").test(el.className);
// } :
// function(el, clss) {
// return el.classList.contains(clss);
// };
/**
* Test for a class name
* @method testForString
......@@ -5772,7 +5788,6 @@
* @param {boolean} nowrap Whether to wrap in space
* @return {boolean} result True/False
*/
// WARNING: requires IE8- requires shim
util.testForString = function (search_string, full_string, nowrap) {
var s = nowrap ? "" : " ";
return (s + full_string + s).indexOf(s + search_string + s) > -1;
......
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