mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +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
|
|
@ -1 +1 @@
|
|||
<div class="js-path reduce-text" title="{{ fullPath }}"><span class="path-icon clear-storage" title="clear storage (Ctrl+D)"></span><span class="path-icon refresh-icon" title="refresh (Ctrl+R)"><a href="{{ link }}"></a></span><span class=links>{{ path }}</span></div>
|
||||
<div data="js-path" class="reduce-text" title="{{ fullPath }}"><span class="path-icon clear-storage" title="clear storage (Ctrl+D)"></span><span class="path-icon refresh-icon" title="refresh (Ctrl+R)"><a href="{{ link }}"></a></span><span class=links>{{ path }}</span></div>
|
||||
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
Expect =
|
||||
'<div id="js-path" class="reduce-text" title="/etc/X11/">' +
|
||||
'<div data="js-path" class="reduce-text" title="/etc/X11/">' +
|
||||
'<span class="path-icon clear-storage" ' +
|
||||
'title="clear storage (Ctrl+D)">' +
|
||||
'</span>' +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue