mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Fix for Menu Manager modal tooltips.
This commit is contained in:
@@ -177,28 +177,20 @@ TEMPL;
|
|||||||
|
|
||||||
e107::getJs()->footerInline("
|
e107::getJs()->footerInline("
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
// Visibility/Instance Options etc.
|
// Visibility/Instance Options etc.
|
||||||
|
|
||||||
$('.e-menumanager-option').on('click', function(){
|
$('.e-menumanager-option').on('click', function(){
|
||||||
|
|
||||||
var link = $(this).attr('href');
|
var link = $(this).attr('href');
|
||||||
var caption = $(this).attr('data-modal-caption');
|
var caption = $(this).attr('data-modal-caption');
|
||||||
|
|
||||||
window.parent.$('#uiModal .modal-caption').text(caption);
|
window.parent.$('#uiModal .modal-caption').text(caption);
|
||||||
|
|
||||||
window.parent.$('#uiModal .modal-body').load(link, function(){
|
window.parent.$('#uiModal .modal-body').load(link, function(){
|
||||||
|
|
||||||
window.parent.$('.modal-body :input').on('change', function(){
|
window.parent.$('.modal-body :input').on('change', function(){
|
||||||
|
|
||||||
var target = window.parent.$('#e-save-form').attr('action');
|
var target = window.parent.$('#e-save-form').attr('action');
|
||||||
var data = window.parent.$('#e-save-form').serialize();
|
var data = window.parent.$('#e-save-form').serialize();
|
||||||
|
|
||||||
// alert(data);
|
|
||||||
// alert(target);
|
|
||||||
$.post(target, data ,function(ret)
|
$.post(target, data ,function(ret)
|
||||||
{
|
{
|
||||||
// alert('Posted: '+ret);
|
|
||||||
// console.log('Posted: '+ ret);
|
|
||||||
|
|
||||||
if(ret == '')
|
if(ret == '')
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -210,39 +202,38 @@ TEMPL;
|
|||||||
{
|
{
|
||||||
alert(a.msg);
|
alert(a.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Attach all registered behaviors to the new content.
|
||||||
|
window.parent.e107.attachBehaviors();
|
||||||
|
});
|
||||||
|
|
||||||
window.parent.$('#uiModal').modal('show');
|
window.parent.$('#uiModal').modal('show');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Delete Button (Remove Menu) Function
|
// Delete Button (Remove Menu) Function
|
||||||
|
|
||||||
$('.e-menumanager-delete').on('click', function(e) {
|
$('.e-menumanager-delete').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var area = 'remove';
|
var area = 'remove';
|
||||||
var remove = $(this).attr('id');
|
var remove = $(this).attr('id');
|
||||||
var opt = remove.split('-');
|
var opt = remove.split('-');
|
||||||
var hidem = '#block-' + opt[1] +'-' + opt[2];
|
var hidem = '#block-' + opt[1] +'-' + opt[2];
|
||||||
|
|
||||||
$(hidem).hide('slow');
|
$(hidem).hide('slow');
|
||||||
// alert(hidem);
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: 'menus.php',
|
url: 'menus.php',
|
||||||
data: { removeid: remove, area: area, mode: 'delete' }
|
data: {
|
||||||
|
removeid: remove,
|
||||||
|
area: area,
|
||||||
|
mode: 'delete'
|
||||||
|
}
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
|
|
||||||
|
|
||||||
var a = $.parseJSON(data);
|
var a = $.parseJSON(data);
|
||||||
|
|
||||||
if(a.error)
|
if(a.error)
|
||||||
@@ -252,17 +243,7 @@ TEMPL;
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
@@ -475,7 +456,7 @@ TEMPL;
|
|||||||
|
|
||||||
.regularMenu { border-bottom:1px dotted silver; margin-bottom:6px; padding-left:3px; padding-right:3px; padding-top:10px; padding-bottom:10px;background-color: #E0EBF1; border-radius: 5px; }
|
.regularMenu { border-bottom:1px dotted silver; margin-bottom:6px; padding-left:3px; padding-right:3px; padding-top:10px; padding-bottom:10px;background-color: #E0EBF1; border-radius: 5px; }
|
||||||
.regularMenu span {padding:3px; font-weight:bold; color:#2F2F2F;text-align:left; }
|
.regularMenu span {padding:3px; font-weight:bold; color:#2F2F2F;text-align:left; }
|
||||||
.ui-draggable { background-color: rgb(245, 245, 245); min-width:100px;}
|
.ui-draggable { min-width:100px;}
|
||||||
|
|
||||||
.regularMenu:hover { background-color: #B1D7EA; }
|
.regularMenu:hover { background-color: #B1D7EA; }
|
||||||
|
|
||||||
|
@@ -18,6 +18,8 @@ button, button:active { outline: 0; }
|
|||||||
.tooltip { font-size: 13px; }
|
.tooltip { font-size: 13px; }
|
||||||
.tooltip-inner { }
|
.tooltip-inner { }
|
||||||
|
|
||||||
|
/* Fix for tooltips inside modal. */
|
||||||
|
.modal-open .tooltip { z-index: 10002; }
|
||||||
|
|
||||||
/* Core Formatting */
|
/* Core Formatting */
|
||||||
.left { text-align: left }
|
.left { text-align: left }
|
||||||
|
@@ -51,6 +51,55 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run tips on .field-help.
|
||||||
|
*
|
||||||
|
* @type {{attach: e107.behaviors.fieldHelpTooltip.attach}}
|
||||||
|
*/
|
||||||
|
e107.behaviors.fieldHelpTooltip = {
|
||||||
|
attach: function (context, settings)
|
||||||
|
{
|
||||||
|
var selector = 'div.tbox,div.checkboxes,input,textarea,select,label,.e-tip,div.form-control';
|
||||||
|
|
||||||
|
$(context).find(selector).once('field-help-tooltip').each(function ()
|
||||||
|
{
|
||||||
|
var $this = $(this);
|
||||||
|
var $fieldHelp = $this.nextAll(".field-help");
|
||||||
|
var placement = 'bottom';
|
||||||
|
|
||||||
|
if($this.is("textarea"))
|
||||||
|
{
|
||||||
|
placement = 'top';
|
||||||
|
}
|
||||||
|
|
||||||
|
var custPlace = $fieldHelp.attr('data-placement'); // ie top|left|bottom|right
|
||||||
|
|
||||||
|
if(custPlace !== undefined)
|
||||||
|
{
|
||||||
|
placement = custPlace;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fieldHelp.hide();
|
||||||
|
|
||||||
|
$this.tooltip({
|
||||||
|
title: function ()
|
||||||
|
{
|
||||||
|
return $fieldHelp.html();
|
||||||
|
},
|
||||||
|
fade: true,
|
||||||
|
html: true,
|
||||||
|
opacity: 1.0,
|
||||||
|
placement: placement,
|
||||||
|
container: 'body',
|
||||||
|
delay: {
|
||||||
|
show: 300,
|
||||||
|
hide: 600
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
(function (jQuery)
|
(function (jQuery)
|
||||||
@@ -453,42 +502,7 @@ $(document).ready(function()
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// run tips on .field-help
|
|
||||||
$("div.tbox,div.checkboxes,input,textarea,select,label,.e-tip,div.form-control").each(function(c) {
|
|
||||||
|
|
||||||
var t = $(this).nextAll(".field-help");
|
|
||||||
|
|
||||||
var placement = 'bottom';
|
|
||||||
|
|
||||||
if($(this).is("textarea"))
|
|
||||||
{
|
|
||||||
var placement = 'top';
|
|
||||||
}
|
|
||||||
|
|
||||||
var custplace = $(t).attr('data-placement'); // ie top|left|bottom|right
|
|
||||||
|
|
||||||
if(custplace !== undefined)
|
|
||||||
{
|
|
||||||
placement = custplace;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
t.hide();
|
|
||||||
// alert('hello');
|
|
||||||
$(this).tooltip({
|
|
||||||
title: function() {
|
|
||||||
var tip = t.html();
|
|
||||||
return tip;
|
|
||||||
},
|
|
||||||
fade: true,
|
|
||||||
html: true,
|
|
||||||
opacity: 1.0,
|
|
||||||
placement: placement,
|
|
||||||
container: 'body',
|
|
||||||
delay: { show: 300, hide: 600 }
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// $(".e-spinner").spinner(); //FIXME breaks tooltips etc.
|
// $(".e-spinner").spinner(); //FIXME breaks tooltips etc.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user