olbers / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

[PATCH] Alter action button in toolbar #133

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I wanted to change the button on the right, in the toolbar, depending on
what page was being displayed.

Usage: <ul actionbutton="{'title' : 'New', 'href' : '#newDialog', 'title' :
null }">

Patch was made against 0.20-beta1

The action expects an object to be returned with the following 3 fields:
title, href, and target.  You may define the href and target as null -
whatever previous value is assigned to the button will stay the same.

The action button will stay as defined on a previous panel if the new panel
does not re-define it.

If you define the action button upfront, please add id="actionButton" to
it.  If you do not define the button, it will be created automatically on
the first panel where the actionbutton is found.

Instead of defining the action button object directly on the actionbutton
attribute, you may supply a javascript function that returns such an object. 

Original issue reported on code.google.com by cwzach...@adelphia.net on 29 Apr 2009 at 1:04

Attachments:

GoogleCodeExporter commented 9 years ago
Please add this feature to the next release of iui.

Original comment by mbac...@gmail.com on 31 May 2009 at 8:59

GoogleCodeExporter commented 9 years ago
i would love to see this one, too.

Thanks for your efforts!

Original comment by kaisergi...@googlemail.com on 30 Jul 2009 at 3:49

GoogleCodeExporter commented 9 years ago
One small addition - i always got a Type Error after using the back button and 
then a
new link.

I changed the bottom of your function in
if (!lSet)
        {
            if (btn)
            {
                btn.style.visibility = (actionButtons[page.id].visible ? "visible" : "hidden");

                if (actionButtons[page.id].title    != null) btn.innerHTML  =
actionButtons[page.id].title;
                if (actionButtons[page.id].href     != null) btn.href       = actionButtons[page.id].href;
                if (actionButtons[page.id].target   != null) btn.target     =
actionButtons[page.id].target;
            }
        }

now it works for me - dont know why it works in the forward direction but not 
in the
backword - you give a look into it? 

Original comment by kaisergi...@googlemail.com on 31 Jul 2009 at 10:22

GoogleCodeExporter commented 9 years ago

Original comment by msgilli...@gmail.com on 7 Aug 2009 at 10:10

GoogleCodeExporter commented 9 years ago
In addition this can be altered to use it for a dynamic backButton, too. 
In my case i use it for example to jump several pages back instead of only one.

Original comment by kaisergi...@googlemail.com on 12 Aug 2009 at 4:12

GoogleCodeExporter commented 9 years ago
Issue 169 has been merged into this issue.

Original comment by melcher....@gmail.com on 20 Aug 2009 at 10:14

GoogleCodeExporter commented 9 years ago
I've applied the changes to fix an issue with the back button for one of our 
pages.

Now I have this:

<form actionbutton="{'title' : 'New', 'Default.aspx' : '#_home', 'title' : null 
}" 
id="login" title="Account" class="panel" action="account.aspx" method="POST">

Doesn't seems to go on my homepage (Default.aspx). Might be because it's on a 
<form> 
tag instead of a <ul> tag?
Any ideas?

Thank you very much,

Charles

Original comment by char...@cableorganizer.com on 15 Dec 2009 at 6:05