Permalink
Browse files

Move shared percentage gate stuff to super class.

  • Loading branch information...
1 parent a3233be commit 0e9868109da8722fef13b7f51854d24afeeeb383 @jnunemaker committed Feb 18, 2013
Showing with 30 additions and 42 deletions.
  1. +6 −16 lib/flipper/ui/assets/javascripts/application.coffee
  2. +24 −26 lib/flipper/ui/public/flipper/js/application.js
@@ -170,38 +170,28 @@ class App.Gate.Actor extends App.Gate
@name = 'actor'
super
-class App.Gate.PercentageOfActors extends App.Gate
+class App.Gate.Percentage extends App.Gate
elements:
'input[type=text]': 'input'
events:
'submit form': 'submit'
- constructor: ->
- @name = 'percentage_of_actors'
- super
-
submit: (event) ->
event.preventDefault()
@gate.value = @input.val()
@gate.save()
-class App.Gate.PercentageOfRandom extends App.Gate
- elements:
- 'input[type=text]': 'input'
-
- events:
- 'submit form': 'submit'
+class App.Gate.PercentageOfActors extends App.Gate.Percentage
+ constructor: ->
+ @name = 'percentage_of_actors'
+ super
+class App.Gate.PercentageOfRandom extends App.Gate.Percentage
constructor: ->
@name = 'percentage_of_random'
super
- submit: (event) ->
- event.preventDefault()
- @gate.value = @input.val()
- @gate.save()
-
class App.GateList extends Spine.Stack
controllers:
boolean: App.Gate.Boolean

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

Oops, something went wrong.

0 comments on commit 0e98681

Please sign in to comment.