mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(dom) getByAttr -> getByDataName
This commit is contained in:
parent
26ee5fb3a1
commit
e98ac2f213
2 changed files with 6 additions and 6 deletions
|
|
@ -210,16 +210,16 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* @param pClass - className
|
||||
* @param pElement - element
|
||||
*/
|
||||
this.getByClass = function(pClass, pElement) {
|
||||
this.getByClass = function(pClass, pElement) {
|
||||
var element = pElement || document,
|
||||
ret = this.getByClassAll(pClass, element)[0];
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
this.getByAttr = function(attribute, element) {
|
||||
this.getByDataName = function(attribute, element) {
|
||||
var ret,
|
||||
selector = '[' + 'data="' + attribute + '"]';
|
||||
selector = '[' + 'data-name="' + attribute + '"]';
|
||||
|
||||
if (!element)
|
||||
element = document;
|
||||
|
|
@ -711,7 +711,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
if (!panel)
|
||||
panel = this.getPanel();
|
||||
|
||||
path = this.getByAttr('js-path', panel);
|
||||
path = this.getByDataName('js-path', panel);
|
||||
ret = path && path.textContent;
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -80,13 +80,13 @@ var Util, DOM, CloudCmd;
|
|||
url = CloudCmd.HOST,
|
||||
loadDirOnce = CloudCmd.loadDir(),
|
||||
panel = DOM.getById(panelId),
|
||||
pathElement = DOM.getByAttr('js-path', panel),
|
||||
pathElement = DOM.getByDataName('js-path', panel),
|
||||
filesElement = DOM.getByClass('files', panel),
|
||||
|
||||
files = filesElement.children,
|
||||
pathLinks = DOM.getByClass('links', pathElement).children,
|
||||
clearStorage = DOM.getByClass('clear-storage', pathElement),
|
||||
refresh = DOM.getByAttr('js-refresh', pathElement),
|
||||
refresh = DOM.getByDataName('js-refresh', pathElement),
|
||||
|
||||
fileClick = function (event) {
|
||||
var ctrl = event.ctrlKey;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue