mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(storage) rm dir -> rm subdirs of dir from storage
This commit is contained in:
parent
f05038d55e
commit
81b18a99c3
2 changed files with 17 additions and 1 deletions
|
|
@ -787,7 +787,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
else
|
||||
DOM.deleteCurrent(current);
|
||||
|
||||
Storage.remove(dir);
|
||||
Storage.removeMatch(dir);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 и
|
||||
* в нём есть нужная нам директория -
|
||||
* записываем данные в него
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue