Convert popup menu AJAX actions from XML to JSON

This commit is contained in:
Kijin Sung 2023-08-30 23:36:26 +09:00
parent e5f53429f7
commit 6e38b440ea

View file

@ -211,7 +211,7 @@
} else { } else {
if(menus) { if(menus) {
var item = menus.item; var item = menus.item || menus;
if(typeof(item.length)=='undefined' || item.length<1) item = new Array(item); if(typeof(item.length)=='undefined' || item.length<1) item = new Array(item);
if(item.length) { if(item.length) {
for(var i=0;i<item.length;i++) { for(var i=0;i<item.length;i++) {
@ -1288,7 +1288,8 @@ jQuery(function($){
evt.pageY = touch.pageY; evt.pageY = touch.pageY;
} }
var action = 'get'+ucfirst(match[2])+'Menu'; var module = match[2];
var action = 'get'+ucfirst(module)+'Menu';
var params = { var params = {
mid : current_mid, mid : current_mid,
cur_mid : current_mid, cur_mid : current_mid,
@ -1304,11 +1305,15 @@ jQuery(function($){
evt.preventDefault(); evt.preventDefault();
evt.stopPropagation(); evt.stopPropagation();
if(is_def(XE.loaded_popup_menus[params.menu_id])) return XE.displayPopupMenu(params, response_tags, params); if(is_def(XE.loaded_popup_menus[params.menu_id])) {
return XE.displayPopupMenu(params, response_tags, params);
}
show_waiting_message = false; show_waiting_message = false;
exec_xml('member', action, params, XE.displayPopupMenu, response_tags, params); exec_json(module + '.' + action, params, function(data) {
show_waiting_message = true; XE.displayPopupMenu(data, response_tags, params);
show_waiting_message = true;
});
}); });
/** /**