feature(refactor) .js-left -> [data=js-left]

This commit is contained in:
coderaiser 2014-02-20 04:54:42 -05:00
parent 8ba75b0ab6
commit 78037c944d
3 changed files with 22 additions and 9 deletions

View file

@ -319,6 +319,18 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
return ret;
};
this.getByAttr = function(attribute, element) {
var ret,
selector = '[' + 'data="' + attribute + '"]';
if (!element)
element = document;
ret = element.querySelector(selector);
return ret;
};
/**
* Function search element by class name
* @param pClass - className
@ -768,15 +780,16 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
/**
* get current direcotory path
*/
this.getCurrentDirPath = function(pPanel) {
var lPanel = pPanel || this.getPanel(),
lPath = this.getByClass('js-path', lPanel),
lRet;
this.getCurrentDirPath = function(panel) {
var ret, path;
if (lPath)
lRet = lPath.textContent;
if (!panel)
panel = this.getPanel(),
return lRet;
path = this.getByAttr('js-path', panel);
ret = path && path.textContent;
return ret;
};
/**