diff --git a/lib/client.js b/lib/client.js index 789a9997..0877d16b 100644 --- a/lib/client.js +++ b/lib/client.js @@ -33,7 +33,7 @@ var Util, DOM, CloudFunc; */ this.loadDir = function(params) { var link, imgPosition, panelChanged, pathParams, - isRefresh, panel, nohistory, + isRefresh, panel, history, p = params, currentLink = DOM.getCurrentLink(), href = currentLink.href; @@ -42,7 +42,7 @@ var Util, DOM, CloudFunc; pathParams = p.path; isRefresh = p.isRefresh; panel = p.panel; - nohistory = p.nohistory; + history = p.history; } if (pathParams) @@ -66,7 +66,7 @@ var Util, DOM, CloudFunc; /* загружаем содержимое каталога */ ajaxLoad(link, { refresh : isRefresh, - nohistory : nohistory + history : history }, panel); } }; @@ -307,7 +307,7 @@ var Util, DOM, CloudFunc; CloudCmd.loadDir({ path : notSlashlLink, isRefresh : NEEDREFRESH, - nohistory : true, + history : false, panel : panel }); }; @@ -317,7 +317,7 @@ var Util, DOM, CloudFunc; * через ajax-запрос. * @param path - каталог для чтения * @param pOptions - * { refresh, nohistory } - необходимость обновить данные о каталоге + * { refresh, history } - необходимость обновить данные о каталоге */ function ajaxLoad(path, options, panel) { if (!options) @@ -329,13 +329,13 @@ var Util, DOM, CloudFunc; var RESTful = DOM.RESTful, obj = Util.parseJSON(json), isRefresh = options.refresh, - nohistory = options.nohistory; + history = options.history; if (!isRefresh && json) - createFileTable(obj, panel, nohistory); + createFileTable(obj, panel, history); else RESTful.read(path, 'json', function(obj) { - createFileTable(obj, panel, nohistory); + createFileTable(obj, panel, history); Storage.set(path, obj); }); }); @@ -345,9 +345,9 @@ var Util, DOM, CloudFunc; * Функция строит файловую таблицу * @param json - данные о файлах * @param panelParam - * @param nohistory + * @param history */ - function createFileTable(json, panelParam, nohistory) { + function createFileTable(json, panelParam, history) { var files, panel = panelParam || DOM.getPanel(), /* getting current element if was refresh */ @@ -396,7 +396,7 @@ var Util, DOM, CloudFunc; current = files[0]; DOM.setCurrentFile(current, { - nohistory: nohistory + history: history }); Listeners.setOnPanel(panel.id); diff --git a/lib/client/dom.js b/lib/client/dom.js index d77b712c..a65bc2ad 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -853,7 +853,11 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; title = CloudFunc.getTitle(path); this.setTitle(title); - if (o && !o.nohistory) { + /* history could be present + * but it should be false + * to prevent default behavior + */ + if (!o || o.history !== false) { if (path !== '/') path = FS + path; @@ -1609,7 +1613,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; current = filesPassive[0]; DOM.setCurrentFile(current, { - nohistory: false + history: true }); return this; diff --git a/lib/client/listeners.js b/lib/client/listeners.js index 1236133b..9e9732b5 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -340,8 +340,8 @@ var Util, DOM, CloudFunc, CloudCmd; if (path) CloudCmd.loadDir({ - path : path, - nohistory: true + path : path, + history : false }); else CloudCmd.route(location.hash);