refactor(dom) getByAttr -> getByDataName

This commit is contained in:
coderaiser 2014-03-17 10:05:56 -04:00
parent 26ee5fb3a1
commit e98ac2f213
2 changed files with 6 additions and 6 deletions

View file

@ -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;

View file

@ -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;