mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(changeLinks) add id
This commit is contained in:
parent
47a220d24d
commit
29888f268a
1 changed files with 12 additions and 6 deletions
|
|
@ -75,7 +75,7 @@ var Util, DOM, CloudCmd;
|
|||
* @param panelId
|
||||
*/
|
||||
this.changeLinks = function(panelId) {
|
||||
var i, n, a, ai, current, link, loadDir, events,
|
||||
var i, n, a, ai, current, link, loadDir, events, id,
|
||||
|
||||
url = CloudCmd.HOST,
|
||||
loadDirOnce = CloudCmd.loadDir(),
|
||||
|
|
@ -175,8 +175,17 @@ var Util, DOM, CloudCmd;
|
|||
|
||||
n = a.length;
|
||||
for (i = 0; i < n ; i++) {
|
||||
current = files[i];
|
||||
ai = a[i];
|
||||
current = files[i];
|
||||
ai = a[i];
|
||||
|
||||
if (ai.title)
|
||||
id = ai.title;
|
||||
else
|
||||
id = ai.textContent;
|
||||
|
||||
id += '(' + panelId + ')';
|
||||
|
||||
current.id = id;
|
||||
|
||||
/* если на файл, а не на папку */
|
||||
if (ai.target === '_blank')
|
||||
|
|
@ -197,9 +206,6 @@ var Util, DOM, CloudCmd;
|
|||
});
|
||||
|
||||
Events.add(events, current);
|
||||
|
||||
current.id = (ai.title ? ai.title : ai.textContent) +
|
||||
'(' + panelId + ')';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue