/* * linotype * https://github.com/typesettin/linotype * @author yaw joseph etse * Copyright (c) 2014 Typesettin. All rights reserved. */ 'use strict'; var classie = require('classie'); // extend = require('util-extend'), // events = require('events'), // util = require('util'); /** * A module that adds simple dom utility functionality. * @author yaw joseph etse * @constructor */ var domhelper = { /** * returns the highest zindex * @param {string} selector - query selector * @return {number} highest z-index * @public */ getHighIndex: function(selector){ if (!selector) { selector = "*"; } var elements = document.querySelectorAll(selector), i = 0, e, s, max = elements.length, found = []; for (; i < max; i += 1) { e = elements[i].style.zIndex; s = elements[i].style.position; if (e && s !== "static") { found.push(parseInt(e, 10)); } } return found.length ? Math.max.apply(null, found) : 0; }, /** * toggles class across nodelist/elementcollection * @param {object} elementCollection - html dom element * @param {object} element - html dom element * @param {string} name of class! * @public */ removeAllClassAndToggle: function(element,elementCollection,toggleClass){ //updating the active class for(var h =0; h