mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(dom) setTitle
This commit is contained in:
parent
8867b15df1
commit
38bca0ae7b
1 changed files with 11 additions and 12 deletions
|
|
@ -1245,22 +1245,21 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
};
|
||||
|
||||
/**
|
||||
* set title with pName
|
||||
* create title element
|
||||
* if it absent
|
||||
* @param pName
|
||||
* set title or create title element
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
|
||||
this.setTitle = function(pName) {
|
||||
this.setTitle = function(name) {
|
||||
if (!Title)
|
||||
Title = DOMTree.getByTag('title')[0] ||
|
||||
DOM.anyload({
|
||||
name:'title',
|
||||
parentElement: document.head,
|
||||
innerHTML: pName
|
||||
});
|
||||
Title = DOM.getByTag('title')[0] ||
|
||||
DOM.anyload({
|
||||
name:'title',
|
||||
parentElement: document.head,
|
||||
innerHTML: name
|
||||
});
|
||||
if (Title)
|
||||
Title.textContent = pName;
|
||||
Title.textContent = name;
|
||||
|
||||
return Title;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue