bug fixes with layout

v2.1
Steve Nyemba 3 months ago
parent 5644e09b6b
commit 5b9d7033ca

@ -85,7 +85,6 @@ def read (**_args):
"""
request = _args['request']
_layout = _args['config']['layout']
_uri = request.args['uri'] # if 'location' in _layout :
# _uri = os.sep.join([_layout['location'],_uri])
_uri = _realpath(_uri, _args['config'])

@ -28,7 +28,7 @@ bootup.CMSObserver = function(_sysId,_domId,_fileURI){
// _domElement.className = 'busy-loading'
// jx.dom.append(_domId, _domElement)
http.post(uri,function(x){
if (x.status == 200){
if (x.status == 200 && x.readyState == 4){
setTimeout(function(){
_content = $(x.responseText)

@ -134,6 +134,7 @@ menu.events._open = function (id,uri,_context){
httpclient.setHeader('uri',uri)
httpclient.setHeader('dom',id)
httpclient.post(_context+'/page',function(x){
if(x.readyState == 4 && x.status == 200){
var _html = x.responseText
var _dom = $(_html)
@ -143,13 +144,10 @@ menu.events._open = function (id,uri,_context){
}
$(pid).append(_dom)
// jx.dom.append(pid,_dom)
// $('#'+id).show('fast',function(){
// $('#'+pid).slideUp()
// })
var ref = pid + ' #'+id
menu.events.finalize (ref)
$(pid).children().slideUp('fast', function(){
$(ref ).slideDown('fast',function(){
$(pid).slideDown('fast',function(){
@ -163,7 +161,8 @@ menu.events._open = function (id,uri,_context){
})
menu.events.finalize (ref)
}
// $('.content').append(_dom)
@ -177,6 +176,7 @@ menu.utils.format = function(text){
}
menu.events.finalize = function (ref) {
var scripts = $(ref+' script')
jx.utils.patterns.visitor(scripts,function(_item){
if(_item.text.trim().length > 0){
@ -280,12 +280,16 @@ var QCMSTabs = function(_layout,_context,_clickEvent){
_button.name = 'menu-tabs'
_label.innerHTML = text.toLowerCase()
_label._uri = _item[0].uri
_button._uri = _label._uri
_button.value= text.toLowerCase()
_label.htmlFor = _button.id
$(_label).on('click',function (){
menu.events._open(this.innerHTML,this._uri,_context)
})
// $(this.tabs).append( [_button,_label])
// $(_button).on('click',function (){
// menu.events._open(this.value,this._uri,_context) ;})
return [_button,_label]
}
@ -316,7 +320,8 @@ var QCMSTabs = function(_layout,_context,_clickEvent){
}
menu.tabs = { }
menu.delegate = { }
// menu.tabs.make = function(text,_clickEvent){
// var _id = text.trim()
// if (text.match(/\//)){
@ -331,7 +336,7 @@ menu.tabs = { }
// $(_label).on('click',_clickEvent)
// return [_button,_label]
// }
menu.tabs.init =function (_layout,_context){
menu.init =function (_layout,_context){
//
// Let us determine what kind of menu is suited for this
// @TODO: Make menus configurable i.e on other areas of the site
@ -361,10 +366,9 @@ menu.tabs.init =function (_layout,_context){
}else{
var _menuObject = new QCMSBasic (_layout,_context)
}
// console.log(_layout)
// var _tabs = new QCMSTabs (_layout)
console.log(_menuObject)
_menuObject.init()
}

@ -57,7 +57,7 @@ Vanderbilt University Medical Center
<script src="{{system.parentContext}}/static/js/fontawesome/js/all.js"></script>
</head>
<script>
sessionStorage.setItem('{{system.id}}','{{system.context|safe}}')
// sessionStorage.setItem('{{system.id}}','{{system.context|safe}}')
var _layout = {{layout|tojson}}
@ -65,8 +65,11 @@ Vanderbilt University Medical Center
$(document).ready( function(){
bootup.init('{{system.id}}',_layout)
menu.init({{layout|tojson}},'{{system.context}}')
})
</script>
<body>

@ -1,3 +1,4 @@
{%if system.portal %}
<div class="icon active">
@ -11,7 +12,3 @@
<i class="fa-solid fa-home"></i>
</div>
{% endif %}
<script>
menu.tabs.init({{layout|tojson}},'{{system.context}}')
</script>
Loading…
Cancel
Save