Ignore:
Timestamp:
03/09/14 14:23:42 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Enable/disable buttons on content change.
  • One place to do date formatting, because it was going wrong again.
  • Serialize questions in survey properly.
  • _ComplexValueMixin consumes submit events, but does trigger outer forms if present.
  • Trigger dialog show/hide for login only after previous effect is finished.
  • Check that documents are actually valid, not just that validator returned a result.
  • Validate email and timestamp formats.
  • Prepared for live runs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.coffee

    r472 r492  
    22    "dijit/_Container",
    33    "dijit/form/_FormMixin",
     4    "dijit/registry",
    45    "dojo/_base/array",
    56    "dojo/_base/declare",
    6     "dojo/_base/event"
    7 ], (_Container, _FormMixin, array, declare, event) ->
     7    "dojo/_base/event",
     8    "dojo/on"
     9], (_Container, _FormMixin, registry, array, declare, event, _on) ->
    810    declare [_Container,_FormMixin],
    911        name: ""
     
    2022                        It is recommended to use <form> as the root
    2123                        element in your template for", @declaredClass
     24            @own ( _on @domNode, 'submit', (evt) => @_handleSubmit evt )
    2225
    2326        _setDisabledAttr: (value) ->
     
    3538            children[0].focus() if children.length > 0
    3639
    37         onSubmit: (e) =>
    38             # since this widget is used to create more complex
    39             # widgets within other forms, the onSubmit must either be
    40             # ignored or propagated, but not handled here.
    41             event.stop e if e
     40        _handleSubmit: (evt) ->
     41            node = @domNode
     42            until not node or ( widget and
     43                                typeof widget._onSubmit is "function" )
     44                node = node.parentNode
     45                widget = registry.byNode node if node
     46            widget._onSubmit(evt) if widget
     47            # we always stop the event, since this is a widget after all
     48            event.stop evt if evt
    4249            false
    43 
    44         _onSubmit: (e) =>
    45             # since this widget is used to create more complex
    46             # widgets within other forms, the onSubmit must either be
    47             # ignored or propagated, but not handled here.
    48             event.stop e if e
    49             false
Note: See TracChangeset for help on using the changeset viewer.