From c634b448280b9a52873cdaf990cfa73f2d48bcdd Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 22 Jan 2014 10:59:30 -0500 Subject: [PATCH] refactor(index) .path -> #js-path --- css/style.css | 5 +---- html/path.html | 2 +- lib/client.js | 2 +- lib/client/dom.js | 9 +++------ lib/client/listeners.js | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/css/style.css b/css/style.css index 8bb969ca..8393a4ba 100644 --- a/css/style.css +++ b/css/style.css @@ -31,7 +31,7 @@ body { background-color:white; } -.fm, .panel-left>li, .panel-right>li, .path, .fm-header, +.fm, .panel-left>li, .panel-right>li, .fm-header, .mini-icon, .name, .size, .owner, .mode, .keyspanel, .cmd-button { -webkit-user-select : none; -moz-user-select : none; @@ -40,9 +40,6 @@ body { user-select : none; } -.path { -} - .path-icon { position : relative; top : 3px; diff --git a/html/path.html b/html/path.html index dc7ab7d1..3a3a9ef4 100644 --- a/html/path.html +++ b/html/path.html @@ -1 +1 @@ -
{{ path }}
\ No newline at end of file +
{{ path }}
\ No newline at end of file diff --git a/lib/client.js b/lib/client.js index e68b6b03..d517e335 100644 --- a/lib/client.js +++ b/lib/client.js @@ -460,7 +460,7 @@ var Util, DOM, CloudFunc; var current, name, size, owner, mode, ret, LEFT = CloudFunc.LEFT_PANEL, left = DOM.getById(LEFT), - path = DOM.getByClass('path').textContent, + path = DOM.getCurrentDirPath(), fileTable = { path : path, diff --git a/lib/client/dom.js b/lib/client/dom.js index 5916389d..5ba337df 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -845,11 +845,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; this.getCurrentDirName = function() { var lRet, lSubstr, - lPanel = this.getPanel(), /* получаем имя каталога в котором находимся */ - lHref = this.getByClass('path', lPanel); - - lHref = lHref.textContent; + lHref = this.getCurrentDirPath(); lHref = CloudFunc.rmLastSlash(lHref); lSubstr = lHref.substr(lHref , lHref.lastIndexOf('/')); @@ -863,7 +860,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; */ this.getCurrentDirPath = function(pPanel) { var lPanel = pPanel || this.getPanel(), - lPath = this.getByClass('path', lPanel), + lPath = this.getById('js-path', lPanel), lRet; if (lPath) @@ -891,7 +888,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; */ this.getNotCurrentDirPath = function() { var lPanel = this.getPanel(true), - lPath = this.getByClass('path', lPanel), + lPath = this.getById('js-path', lPanel), lRet; if (lPath) diff --git a/lib/client/listeners.js b/lib/client/listeners.js index 70edfdbc..9adf852b 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -77,7 +77,7 @@ var Util, DOM, CloudCmd; this.changeLinks = function(pPanelID) { /* назначаем кнопку очистить кэш и показываем её */ var lPanel = DOM.getById(pPanelID), - pathElement = DOM.getByClass('path', lPanel), + pathElement = DOM.getById('js-path', lPanel), pathLinks = DOM.getByClass('links', pathElement).children, clearStorage = DOM.getByClass('clear-storage', pathElement), refresh = DOM.getByClass('refresh-icon', pathElement),