diff --git a/lib/client/dom.js b/lib/client/dom.js index a7b043f8..6833b56c 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -787,7 +787,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; else DOM.deleteCurrent(current); - Storage.remove(dir); + Storage.removeMatch(dir); }); }; diff --git a/lib/client/storage.js b/lib/client/storage.js index e4ba53e7..3e53d8c8 100644 --- a/lib/client/storage.js +++ b/lib/client/storage.js @@ -40,6 +40,22 @@ var Util, DOM; return this; }; + this.removeMatch = function(string, callback) { + var name, is, + reg = new RegExp('^' + string + '.*$'); + + for (name in localStorage) { + is = name.match(reg); + + if (is) + localStorage.removeItem(name); + } + + Util.exec(callback); + + return this; + }; + /** если доступен localStorage и * в нём есть нужная нам директория - * записываем данные в него