Skip to content

Commit

Permalink
Merge pull request #326 from zopefoundation/re-316-broken-zsqlmethod-…
Browse files Browse the repository at this point in the history
…addItem

Fix action extraction for addItem.
  • Loading branch information
dwt committed Oct 1, 2018
2 parents 41ac177 + d6f77aa commit 66ba443
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Bugfixes
native ``str`` on both Python versions.
(`#265 <https://github.com/zopefoundation/Zope/pull/265>`_)

- Inlcude the ``zmi.styles`` repository in this package to break a circular
- Include the ``zmi.styles`` repository in this package to break a circular
dependency.
(`#307 <https://github.com/zopefoundation/Zope/pull/307>`_)

Expand Down
9 changes: 7 additions & 2 deletions src/zmi/styles/resources/zmi_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ function toggle_menu() {

// [2] Add New Object Item (with Modal Dialog)
function addItem( elm, base_url ) {
// e.g. manage_addProduct/OFSP/folderAdd
var url_action = elm.options[elm.selectedIndex].value;
// http://localhost/myfolder/manage_addProduct/OFSP/folderAdd
var url_full = base_url + '/' + url_action;
var action = url_action.split('/')[url_action.split('/').length-1];
var modal_form_base = url_full.split(action)[0];
var parts = url_action.split('/');
// folderAdd
var action = parts[parts.length-1];
// http://localhost/myfolder/manage_addProduct/OFSP/
var modal_form_base = url_full.slice(0, -action.length);
var modal_body_url = url_full + '?zmi_dialog=modal';

// List of Object Types Inserting Without Modal Dialog
Expand Down

0 comments on commit 66ba443

Please sign in to comment.