mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
add optional confirm dialog to removeAt()
This commit is contained in:
parent
6f1ac0c79e
commit
385704aad7
1 changed files with 6 additions and 1 deletions
|
|
@ -104,7 +104,12 @@ get '/', (page, model, params, next) ->
|
|||
# ========== CONTROLLER FUNCTIONS ==========
|
||||
|
||||
ready (model) ->
|
||||
exports.removeAt = (e) -> e.at().remove() # used for things like remove website, chat, etc
|
||||
# used for things like remove website, chat, etc
|
||||
exports.removeAt = (e, el) ->
|
||||
if (confirmMessage = $(el).attr 'data-confirm')?
|
||||
return unless confirm(confirmMessage) is true
|
||||
debugger
|
||||
e.at().remove()
|
||||
|
||||
user = model.at('_user')
|
||||
misc.fixCorruptUser(model) # https://github.com/lefnire/habitrpg/issues/634
|
||||
|
|
|
|||
Loading…
Reference in a new issue