web/data/cubicweb.ajax.js
branchtls-sprint
changeset 1407 75863d3ffd9b
parent 1320 c85f4d8eff8b
child 1419 7ff24154351d
equal deleted inserted replaced
1406:133476216f4a 1407:75863d3ffd9b
    16  */
    16  */
    17 function loadAjaxHtmlHead(node) {
    17 function loadAjaxHtmlHead(node) {
    18     jQuery(node).find('div.ajaxHtmlHead').appendTo(jQuery('head'));
    18     jQuery(node).find('div.ajaxHtmlHead').appendTo(jQuery('head'));
    19 }
    19 }
    20 
    20 
    21 function postAjaxLoad(node, req) {
    21 function postAjaxLoad(node) {
    22     // addStylesheets(evalJSON(req.getResponseHeader('X-Cubicweb-Stylesheets') || '[]'));
       
    23     loadAjaxHtmlHead(node);
    22     loadAjaxHtmlHead(node);
    24     // find sortable tables if there are some
    23     // find sortable tables if there are some
    25     if (typeof(Sortable) != 'undefined') {
    24     if (typeof(Sortable) != 'undefined') {
    26 	Sortable.sortTables(node);
    25 	Sortable.sortTables(node);
    27     }
    26     }
    69 	} else if (mode == 'replace') {
    68 	} else if (mode == 'replace') {
    70 	    jQuery(node).empty().append(domnode);
    69 	    jQuery(node).empty().append(domnode);
    71 	} else if (mode == 'append') {
    70 	} else if (mode == 'append') {
    72 	    jQuery(node).append(domnode);
    71 	    jQuery(node).append(domnode);
    73 	}
    72 	}
    74 	postAjaxLoad(node, req);
    73 	postAjaxLoad(node);
    75 	while (jQuery.isFunction(callback)) {
    74 	while (jQuery.isFunction(callback)) {
    76 	    callback = callback.apply(this, [domnode]);
    75 	    callback = callback.apply(this, [domnode]);
    77 	}
    76 	}
    78     });
    77     });
    79 };
    78 };