Ignore:
Timestamp:
2 Sep 2012, 07:20:56 (12 years ago)
Author:
Henrik Bettermann
Message:

Add onclick attribute to action buttons and protect the deactivate and activate buttons by a warning message.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/actionbutton.pt

    r7459 r9145  
    11<a class="btn actionbar" tal:condition="viewlet/target_url"
    2    tal:attributes="href viewlet/target_url">
     2   tal:attributes="href viewlet/target_url; onclick viewlet/onclick">
    33  <img src="" alt="edit"
    44   tal:attributes="src viewlet/icon_url;
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r9024 r9145  
    6666    """A base for action buttons.
    6767
    68     An action button provides an icon, some text and links to a
    69     target.  If you want to set a different text, icon or target name
     68    An action button provides an icon, some text, links to a
     69    target and optionally an onclick event handler.
     70    If you want to set a different text, icon or target name
    7071    for some active button below, just override the approriate
    7172    attribute in the concerned viewlet.
     
    8283     * ``target_url``
    8384          The URL of the link target.
     85
     86     * ``onclick``
     87          An onclick Javascript event handler.
    8488
    8589    """
     
    142146        """
    143147        return self.view.url(self.view.context, self.target)
     148
     149    @property
     150    def onclick(self):
     151        """Onclick event...
     152        """
     153        return
    144154
    145155class PlainActionButton(ActionButton):
Note: See TracChangeset for help on using the changeset viewer.