Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
adding new content now functional, loading spinner still missing but …
Browse files Browse the repository at this point in the history
…its working at least
  • Loading branch information
garbas committed Jun 30, 2012
1 parent 3593b5d commit 73447fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions plone/app/toolbar/resources/src/plone.cmsui.js
Expand Up @@ -44,7 +44,6 @@ $.plone.cmsui = $.plone.cmsui || {};
$.each([
'#plone-toolbar ul.nav > li#plone-action-contentrules > a',
'#plone-toolbar ul.nav > li#plone-action-local_roles > a',
'#plone-toolbar ul.nav > li#plone-contentmenu-factories > ul > li > a',
'#plone-toolbar ul.nav > li#plone-contentmenu-workflow > ul > li#advanced > a',
'#plone-toolbar ul.nav > li#plone-contentmenu-display > ul > li#folderChangeDefaultPage > a',
'#plone-toolbar ul.nav > li#plone-contentmenu-display > ul > li#contextSetDefaultPage > a',
Expand All @@ -60,9 +59,18 @@ $.each([
$('#plone-toolbar ul.nav > li#plone-action-folderContents a').ploneOverlay({
});

// # Edit Action
$('#plone-toolbar ul.nav > li#plone-action-edit > a,' +
'#plone-toolbar ul.nav > li#plone-contentmenu-factories > ul > li > a').ploneOverlay({

// "Add new ..." Action
$('#plone-toolbar ul.nav > li#plone-contentmenu-factories > ul > li > a').ploneOverlay({
save: function(response, state, xhr, form) {
// XXX: not sure if this is correct solution, check with others on mailing
// list. what we do is we parse out base from responseText
window.parent.location.href = $($(xhr.responseText).filter('base')[0]).attr('href');
}
});

// # "Edit" Action
$('#plone-toolbar ul.nav > li#plone-action-edit > a').ploneOverlay({
save: function(response) {
$('#content', window.parent.document).replaceWith($('#content', response));
this.destroy();
Expand Down
4 changes: 2 additions & 2 deletions plone/app/toolbar/resources/src/plone.overlay.js
Expand Up @@ -33,7 +33,7 @@
/*jshint bitwise:true, curly:true, eqeqeq:true, immed:true, latedef:true,
newcap:true, noarg:true, noempty:true, nonew:true, plusplus:true,
undef:true, strict:true, trailing:true, browser:true */
/*global TinyMCEConfig:false, jQuery:false */
/*global tinyMCE:false, TinyMCEConfig:false, jQuery:false */


(function($) {
Expand Down Expand Up @@ -126,7 +126,7 @@ $.plone.overlay.Overlay.prototype = {
textarea_id = textarea.attr('id');
if (textarea.size() !== 0 &&
tinyMCE.editors[textarea_id] !== undefined) {
tinyMCE.editors[textarea_id].save()
tinyMCE.editors[textarea_id].save();
tinyMCE.editors[textarea_id].remove();
}
},
Expand Down

0 comments on commit 73447fc

Please sign in to comment.