mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 15:16:30 +02:00
Merge pull request #2738 from lonalore/admin_ui
Quickfix for Media Manager filtering.
This commit is contained in:
@@ -6731,13 +6731,12 @@ class e_admin_form_ui extends e_form
|
|||||||
",'prototype');
|
",'prototype');
|
||||||
|
|
||||||
// TODO implement ajax queue
|
// TODO implement ajax queue
|
||||||
// FIXME - dirty way to register events after ajax update - DO IT RIGHT - see all.jquery, create object
|
// FIXME
|
||||||
// and use handler, re-register them global after ajax update (context)
|
// dirty way to register events after ajax update - DO IT RIGHT - see all.jquery, create object and use handler,
|
||||||
|
// re-register them global after ajax update (context)... use behaviors and call e107.attachBehaviors();
|
||||||
e107::js('footer-inline',"
|
e107::js('footer-inline',"
|
||||||
var filterRunning = false, request;
|
var filterRunning = false, request;
|
||||||
var applyAfterAjax = function(context) {
|
var applyAfterAjax = function(context) {
|
||||||
\$('.e-hideme', context).hide();
|
|
||||||
\$('.e-expandit', context).show();
|
|
||||||
\$('.e-expandit', context).click(function () {
|
\$('.e-expandit', context).click(function () {
|
||||||
var href = (\$(this).is('a')) ? \$(this).attr('href') : '';
|
var href = (\$(this).is('a')) ? \$(this).attr('href') : '';
|
||||||
if(href == '' && \$(this).attr('data-target'))
|
if(href == '' && \$(this).attr('data-target'))
|
||||||
@@ -6786,7 +6785,10 @@ class e_admin_form_ui extends e_form
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cont.html(data).css({ opacity: 1 });
|
cont.html(data).css({ opacity: 1 });
|
||||||
|
// TODO remove applyAfterAjax() and use behaviors!
|
||||||
applyAfterAjax(cont);
|
applyAfterAjax(cont);
|
||||||
|
// Attach behaviors to the newly loaded contents.
|
||||||
|
e107.attachBehaviors();
|
||||||
}, 700);
|
}, 700);
|
||||||
}, 'html')
|
}, 'html')
|
||||||
.error(function() {
|
.error(function() {
|
||||||
|
@@ -315,6 +315,36 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Behavior to hide elements.
|
||||||
|
*
|
||||||
|
* @type {{attach: e107.behaviors.eHideMe.attach}}
|
||||||
|
*/
|
||||||
|
e107.behaviors.eHideMe = {
|
||||||
|
attach: function (context, settings)
|
||||||
|
{
|
||||||
|
$(context).find('.e-hideme').once('e-hide-me').each(function ()
|
||||||
|
{
|
||||||
|
$(this).hide();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Behavior to show elements.
|
||||||
|
*
|
||||||
|
* @type {{attach: e107.behaviors.eExpandIt.attach}}
|
||||||
|
*/
|
||||||
|
e107.behaviors.eExpandIt = {
|
||||||
|
attach: function (context, settings)
|
||||||
|
{
|
||||||
|
$(context).find('.e-expandit').once('e-expand-it').each(function ()
|
||||||
|
{
|
||||||
|
$(this).show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the selector is valid.
|
* Check if the selector is valid.
|
||||||
*
|
*
|
||||||
@@ -715,12 +745,6 @@ $.ajaxSetup({
|
|||||||
|
|
||||||
$(document).ready(function()
|
$(document).ready(function()
|
||||||
{
|
{
|
||||||
$(".e-hideme").hide();
|
|
||||||
$(".e-expandit").show();
|
|
||||||
|
|
||||||
// $(".e-spinner").spinner(); //FIXME breaks tooltips
|
|
||||||
|
|
||||||
|
|
||||||
//check all
|
//check all
|
||||||
$("#check-all").click(function(event){
|
$("#check-all").click(function(event){
|
||||||
var val = $(this).val(), selector = '.field-spacer';
|
var val = $(this).val(), selector = '.field-spacer';
|
||||||
|
Reference in New Issue
Block a user