Hello,
If anyone is interested I modified the context_inline_editor.js so it work with the Administration Menu module.
http://drupal.org/project/admin_menu
For the modification to work you must enable the core "toolbar" module.
In the Administration Menu configuration screen disable Client side caching.
(function ($) {
Drupal.behaviors.contextInlineEditor = {
attach: function() {
$('div[id="toolbar"]:not(div[id="toolbar"].contextInlineEditor-processed)').each(function() {
$(this).append('<a class="context-inline-editor-edit" href="#">Edit contexts</a>');
$('.context-inline-editor-edit').click(function(e){
$('#context-inline-editor').removeClass('element-invisible').dialog({
title: Drupal.t('Context editor'),
position: ['left','top'],
buttons: {
'Save': function() {
$('#context-inline-editor a.done:visible').click();
$('.context-inline-editor-save').click();
},
'Cancel': function() {
$('.context-inline-editor-cancel').click();
}
},
beforeClose: function() {
if (confirm('Do you want to save your changes?')) {
$('#context-inline-editor a.done:visible').click();
$('.context-inline-editor-save').click();
}
else {
$('.context-inline-editor-cancel').click();
}
},
autoResize:true
}).parent().css({position:'fixed'});
e.preventDefault();
return false;
});
}).addClass('contextInlineEditor-processed');
}
};
$(document).ready(function ($) {
$('div[id="toolbar"]:not(div[id="toolbar"].contextInlineEditor-processed)').each(function() {
$(this).append('<a class="context-inline-editor-edit" href="#">Edit contexts</a>');
$('.context-inline-editor-edit').click(function(e){
$('#context-inline-editor').removeClass('element-invisible').dialog({
title: Drupal.t('Context editor'),
position: ['left','top'],
buttons: {
'Save': function() {
$('#context-inline-editor a.done:visible').click();
$('.context-inline-editor-save').click();
},
'Cancel': function() {
$('.context-inline-editor-cancel').click();
}
},
beforeClose: function() {
if (confirm('Do you want to save your changes?')) {
$('#context-inline-editor a.done:visible').click();
$('.context-inline-editor-save').click();
}
else {
$('.context-inline-editor-cancel').click();
}
},
autoResize:true
}).parent().css({position:'fixed'});
e.preventDefault();
return false;
});
}).addClass('contextInlineEditor-processed');
});
})(jQuery);
Comments
Comment #1
Fidelix commentedEnabling the core toolbar is a no go, but thank you for the attempt, emptyvoid!
Comment #2
dagomar commentedHad the same issue and changed 2 lines to this module to make it happen (it will now use the shortcut bar, absolutely no need for the toolbar module).
context_inline_editor.info line 4
dependencies[] = shortcutcontext_inline_editor.js line 4
$('div.toolbar-shortcuts:not(.contextInlineEditor-processed)').each(function() {// Edit: For this to work "Cache menu in client-side browser" must be turned off in the administration menu settings...
Comment #3
Fidelix commentedOr we could use $.live to do this. I'll try it as soon as I have some time.
Comment #4
rooby commentedI think it needs to be usable without the toolbar or the shortcut bar.
I use admin menu without the other two and I'm sure a lot of other people do too.
I haven't looked into how it actually works but would it be feasible to use contextual links in some way?
Comment #5
michaellander commentedI agree that it would be nice to remove the dependency of toolbar. Maybe if I get some free time I can look into it.
Comment #6
marcoka commentedyep nice module. but i agree, toolbar is a no go