mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-04 13:43:23 +00:00
feature(refactor) .js-left -> [data=js-left]
This commit is contained in:
parent
8ba75b0ab6
commit
78037c944d
3 changed files with 22 additions and 9 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue