|
|
|
@ -117,7 +117,7 @@ menu.events._dialog = function (_item,_context){
|
|
|
|
|
http.get(_context+'/dialog',function(x){
|
|
|
|
|
|
|
|
|
|
jx.modal.show({html:x.responseText,id:'dialog'})
|
|
|
|
|
// menu.events.finalize ('.jxmodal')
|
|
|
|
|
menu.events.finalize ('.jxmodal')
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -129,6 +129,7 @@ menu.events._open = function (id,uri,_context){
|
|
|
|
|
|
|
|
|
|
$('.content').children().slideUp()
|
|
|
|
|
$('#'+id).remove()
|
|
|
|
|
|
|
|
|
|
var httpclient = HttpClient.instance()
|
|
|
|
|
_context = (_context == null)?'':_context;
|
|
|
|
|
httpclient.setHeader('uri',uri)
|
|
|
|
@ -138,14 +139,13 @@ menu.events._open = function (id,uri,_context){
|
|
|
|
|
var _html = x.responseText
|
|
|
|
|
var _dom = $(_html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(jx.dom.exists(pid) && jx.dom.exists(id)){
|
|
|
|
|
jx.dom.remove(id)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$(pid).append(_dom)
|
|
|
|
|
var ref = pid + ' #'+id
|
|
|
|
|
menu.events.finalize (ref)
|
|
|
|
|
// menu.events.finalize (ref)
|
|
|
|
|
$(pid).children().slideUp('fast', function(){
|
|
|
|
|
|
|
|
|
|
$(ref ).slideDown('fast',function(){
|
|
|
|
@ -174,6 +174,20 @@ menu.utils = {}
|
|
|
|
|
menu.utils.format = function(text){
|
|
|
|
|
return text.replace(/(-|_)/g,' ').trim()
|
|
|
|
|
}
|
|
|
|
|
menu.utils._delegate = function (_id,_itemIndex,_index) {
|
|
|
|
|
if ($(_id).children().length >= _itemIndex ){
|
|
|
|
|
var _node = $(_id).children()[_itemIndex ]
|
|
|
|
|
if ($(_node).children().length >= _index ){
|
|
|
|
|
var _node = $(_node).children()[_index]
|
|
|
|
|
_node = $(_node).find('.active')
|
|
|
|
|
if ($(_node).length > 0 ){
|
|
|
|
|
$(_node)[0].click()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
menu.events.finalize = function (ref) {
|
|
|
|
|
var scripts = $(ref+' script')
|
|
|
|
|
|
|
|
|
@ -202,6 +216,7 @@ var QCMSBasic= function(_layout,_context,_clickEvent) {
|
|
|
|
|
this._make = function (_items){
|
|
|
|
|
var _panes = []
|
|
|
|
|
var _context = this._context ;
|
|
|
|
|
|
|
|
|
|
_items.forEach(_item=>{
|
|
|
|
|
var _div = jx.dom.get .instance('DIV')
|
|
|
|
|
|
|
|
|
@ -215,17 +230,20 @@ var QCMSBasic= function(_layout,_context,_clickEvent) {
|
|
|
|
|
$(_div).on('click', function (){
|
|
|
|
|
//
|
|
|
|
|
// how do we process this ...
|
|
|
|
|
|
|
|
|
|
if(this.data.uri) {
|
|
|
|
|
if(this.data.uri && this.data.type != 'open') {
|
|
|
|
|
|
|
|
|
|
if (this.data.type == 'dialog') {
|
|
|
|
|
menu.events._dialog(this.data,_context)
|
|
|
|
|
}else{
|
|
|
|
|
menu.events._open(menu.utils.format(this.data.text),this.data.uri,_context)
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if (this.data.uri != null){
|
|
|
|
|
window.open(this.data.uri,'_self')
|
|
|
|
|
}else{
|
|
|
|
|
window.open(this.data.url,menu.utils.format(this.data.text))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -242,6 +260,7 @@ var QCMSBasic= function(_layout,_context,_clickEvent) {
|
|
|
|
|
|
|
|
|
|
// Object.keys(this._layout.menu)
|
|
|
|
|
_names.forEach(function(_name){
|
|
|
|
|
|
|
|
|
|
var _div = _me._make(_layout.menu[_name]) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|