Skip to content

Commit 1dfd531

Browse files
authored
Adding option to the navMenu to add a target when generating links in ExtJS. (#926)
1 parent e41326d commit 1dfd531

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

ehr/resources/web/ehr/navMenu.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,19 @@ Ext4.define('EHR.NavMenu', {
107107
item = this.renderer(tmp.items[j])
108108
}
109109
else {
110-
//NOTE: this is the default renderer
111-
item = {
112-
//Creates links for the navigation panel
113-
html: '<a href="'+tmp.items[j].url+'">'+tmp.items[j].name+'</a>'
110+
if (tmp.items[j].target){
111+
item = {
112+
//Creates links for the navigation panel to a target
113+
html: '<a target="'+tmp.items[j].target+'" href="'+tmp.items[j].url+'">'+tmp.items[j].name+'</a>'
114+
}
115+
}else{
116+
item = {
117+
//Creates links for the navigation panel
118+
html: '<a href="'+tmp.items[j].url+'">'+tmp.items[j].name+'</a>'
119+
}
114120
}
121+
//NOTE: this is the default renderer
122+
115123
}
116124
section.add(item)
117125
}

0 commit comments

Comments
 (0)