Permalink
Browse files

Simplified the JS by getting rid of "if not"

  • Loading branch information...
1 parent 18e593e commit 811669eb0a56fd18b84e5cee10b6c7ad6b21f6b4 @fredwu fredwu committed Feb 8, 2013
Showing with 9 additions and 9 deletions.
  1. +3 −3 lib/ajax-chosen.js
  2. +3 −3 lib/ajax-chosen.min.js
  3. +3 −3 src/ajax-chosen.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -62,7 +62,7 @@ do ($ = jQuery) ->
field = $(@)
# Default term key is `term`. Specify alternative in options.options.jsonTermKey
- options.data = {} if not options.data?
+ options.data = {} unless options.data?
options.data[options.jsonTermKey] = val
options.data = options.dataCallback(options.data) if options.dataCallback?
@@ -74,14 +74,14 @@ do ($ = jQuery) ->
# finished.
options.success = (data) ->
# Exit if the data we're given is invalid
- return if not data?
+ return unless data?
# Go through all of the <option> elements in the <select> and remove
# ones that have not been selected by the user. For those selected
# by the user, add them to a list to filter from the results later.
selected_values = []
select.find('option').each ->
- if not $(@).is(":selected")
+ if $(@).not(":selected")
$(@).remove()
else
selected_values.push $(@).val() + "-" + $(@).text()

0 comments on commit 811669e

Please sign in to comment.