Sha256: c0c15f5112d1d17aef9ad1b143ed2ef2339d38d6117217d491304c1f137bebee
Contents?: true
Size: 891 Bytes
Versions: 50
Compression:
Stored size: 891 Bytes
Contents
# Confirm # #= require ./prepare # # Prompts native confirm dialog before activating link. # # ### Markup # # `<a>` # # ``` definition-table # Attribute - Description # # `data-confirm` - Message to pass to `confirm()`. # ``` # # ``` html # <a href="/" data-confirm="Are you sure?">Delete</a> # ``` # # `<button>` # # ``` definition-table # Attribute - Description # # `data-confirm` - Message to pass to `confirm()`. # ``` # # ``` html # <button type="submit" data-confirm="Are you sure?">Delete</a> # ``` $(document).on 'click:prepare', 'a[data-confirm], button[data-confirm]', (event) -> if message = $(this).attr 'data-confirm' # Prompt message with native confirm dialog unless confirm message # Prevent other handlers on the document from running event.stopImmediatePropagation() # Prevent default action from running event.preventDefault() return
Version data entries
50 entries across 50 versions & 1 rubygems