Skip to content

Instantly share code, notes, and snippets.

@kakubei
Created February 6, 2014 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kakubei/8844995 to your computer and use it in GitHub Desktop.
Save kakubei/8844995 to your computer and use it in GitHub Desktop.
Substitute regular javascript alert with JQuery one using Coffeescript
window.alert = (message) ->
$(document.createElement("div")).attr(
title: "Alert"
class: "alert"
).html(message).dialog
buttons:
OK: ->
$(this).dialog "close"
return
close: ->
$(this).remove()
return
draggable: true
modal: true
resizable: false
width: "auto"
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment