mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactor(load) getIdBySrc: while -> replace
This commit is contained in:
parent
97404e50c3
commit
4d9626e2f9
1 changed files with 4 additions and 5 deletions
|
|
@ -143,13 +143,12 @@ var Util, DOM;
|
|||
if (~src.indexOf(':'))
|
||||
src += '-join';
|
||||
|
||||
num = src.lastIndexOf('/') + 1,
|
||||
sub = src.substr(src, num),
|
||||
id = Util.rmStrOnce(src, sub);
|
||||
num = src.lastIndexOf('/') + 1,
|
||||
sub = src.substr(src, num),
|
||||
id = Util.rmStrOnce(src, sub);
|
||||
|
||||
/* убираем точки */
|
||||
while (id.indexOf('.') > 0)
|
||||
id = id.replace('.', '-');
|
||||
id = id.replace(/\./g, '-');
|
||||
}
|
||||
|
||||
return id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue