This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Button added. Behaviour almost finished. We need to set the mps publi…
…sh event
- Loading branch information
Miguel Barrenechea
committed
Nov 11, 2015
1 parent
e382094
commit 6b05912
Showing
6 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/assets/javascripts/compare/presenters/CompareGridButtonBoxPresenter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
define([ | ||
'backbone', | ||
'mps', | ||
'compare/presenters/PresenterClass', | ||
], function(Backbone, mps, PresenterClass) { | ||
|
||
'use strict'; | ||
|
||
var CompareSelectorsPresenter = PresenterClass.extend({ | ||
|
||
init: function(view) { | ||
this._super(); | ||
this.view = view; | ||
}, | ||
|
||
/** | ||
* Application subscriptions. | ||
*/ | ||
_subscriptions: [], | ||
|
||
showIndicatorModal: function() { | ||
// mps publish an event that makes the indicator modal show | ||
console.log("Let's show the indicator modal") | ||
} | ||
|
||
}); | ||
|
||
return CompareSelectorsPresenter; | ||
|
||
}); |
1 change: 1 addition & 0 deletions
1
app/assets/javascripts/compare/templates/compareGridButtonBox.handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<button class="addIndicators btn medium blue">Customize indicators</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
app/assets/javascripts/compare/views/index/CompareGridButtonBoxView.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
define([ | ||
'backbone', | ||
'compare/presenters/CompareGridButtonBoxPresenter', | ||
'text!compare/templates/compareGridButtonBox.handlebars', | ||
], function(Backbone, CompareGridButtonBoxPresenter, tpl) { | ||
|
||
var CompareGridButtonBoxView = Backbone.View.extend({ | ||
|
||
el: '#compareGridButtonBox', | ||
|
||
template: Handlebars.compile(tpl), | ||
|
||
events: { | ||
'click .addIndicators' : 'showIndicatorModal' | ||
}, | ||
|
||
initialize:function() { | ||
this.presenter = new CompareGridButtonBoxPresenter(this); | ||
this.render(); | ||
}, | ||
|
||
render: function() { | ||
this.$el.html(this.template()); | ||
}, | ||
|
||
// Events | ||
showIndicatorModal: function(e) { | ||
e && e.preventDefault(); | ||
this.presenter.showIndicatorModal(); | ||
} | ||
|
||
}); | ||
|
||
return CompareGridButtonBoxView; | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
app/assets/stylesheets/modules/compare/_m-compare-grid-button-box.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.m-compare-grid-button-box { | ||
display: flex; | ||
flex-direction: row-reverse; | ||
padding: 0 0 50px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters