Skip to content
This repository has been archived by the owner on Apr 26, 2018. It is now read-only.

Commit

Permalink
Emit a deprecation warning when accessing deprecated views via $::view
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Sobo committed Jan 2, 2015
1 parent 5456a32 commit 814ae2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -36,7 +36,7 @@
"grunt-atomdoc": "^1.0.0"
},
"dependencies": {
"grim": "^0.12.0",
"grim": "^0.13.0",
"underscore-plus": "1.x"
}
}
6 changes: 5 additions & 1 deletion src/space-pen.coffee
Expand Up @@ -282,7 +282,11 @@ class Builder
# jQuery extensions

$.fn.view = ->
@[0]?.spacePenView
if element = @[0]
if element.__spacePenView?
viewConstructorName = element.__spacePenView.constructor.name
Grim?.deprecate("Accessing `#{viewConstructorName}` via `$::view()` is deprecated. Use the raw DOM node or underlying model object instead.")
element.spacePenView

$.fn.views = -> @toArray().map (elt) ->
$elt = $(elt)
Expand Down

0 comments on commit 814ae2e

Please sign in to comment.