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'] request = _args['request']
_layout = _args['config']['layout'] _layout = _args['config']['layout']
_uri = request.args['uri'] # if 'location' in _layout : _uri = request.args['uri'] # if 'location' in _layout :
# _uri = os.sep.join([_layout['location'],_uri]) # _uri = os.sep.join([_layout['location'],_uri])
_uri = _realpath(_uri, _args['config']) _uri = _realpath(_uri, _args['config'])

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

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

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

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