Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move shared percentage gate stuff to super class.

  • Loading branch information...
commit 0e9868109da8722fef13b7f51854d24afeeeb383 1 parent a3233be
@jnunemaker authored
View
22 lib/flipper/ui/assets/javascripts/application.coffee
@@ -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
View
50 lib/flipper/ui/public/flipper/js/application.js
@@ -314,59 +314,57 @@
})(App.Gate);
- App.Gate.PercentageOfActors = (function(_super) {
+ App.Gate.Percentage = (function(_super) {
- __extends(PercentageOfActors, _super);
+ __extends(Percentage, _super);
- PercentageOfActors.prototype.elements = {
+ function Percentage() {
+ return Percentage.__super__.constructor.apply(this, arguments);
+ }
+
+ Percentage.prototype.elements = {
'input[type=text]': 'input'
};
- PercentageOfActors.prototype.events = {
+ Percentage.prototype.events = {
'submit form': 'submit'
};
- function PercentageOfActors() {
- this.name = 'percentage_of_actors';
- PercentageOfActors.__super__.constructor.apply(this, arguments);
- }
-
- PercentageOfActors.prototype.submit = function(event) {
+ Percentage.prototype.submit = function(event) {
event.preventDefault();
this.gate.value = this.input.val();
return this.gate.save();
};
- return PercentageOfActors;
+ return Percentage;
})(App.Gate);
- App.Gate.PercentageOfRandom = (function(_super) {
+ App.Gate.PercentageOfActors = (function(_super) {
- __extends(PercentageOfRandom, _super);
+ __extends(PercentageOfActors, _super);
- PercentageOfRandom.prototype.elements = {
- 'input[type=text]': 'input'
- };
+ function PercentageOfActors() {
+ this.name = 'percentage_of_actors';
+ PercentageOfActors.__super__.constructor.apply(this, arguments);
+ }
- PercentageOfRandom.prototype.events = {
- 'submit form': 'submit'
- };
+ return PercentageOfActors;
+
+ })(App.Gate.Percentage);
+
+ App.Gate.PercentageOfRandom = (function(_super) {
+
+ __extends(PercentageOfRandom, _super);
function PercentageOfRandom() {
this.name = 'percentage_of_random';
PercentageOfRandom.__super__.constructor.apply(this, arguments);
}
- PercentageOfRandom.prototype.submit = function(event) {
- event.preventDefault();
- this.gate.value = this.input.val();
- return this.gate.save();
- };
-
return PercentageOfRandom;
- })(App.Gate);
+ })(App.Gate.Percentage);
App.GateList = (function(_super) {
Please sign in to comment.
Something went wrong with that request. Please try again.