This file contains hidden or 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
I have: | |
Skepic.DashPlot = Backbone.View.extend | |
... | |
But want (dash_plot is a precreated object): | |
((dash_plot)-> | |
dash_plot.extend Backbone.View, | |
... |
This file contains hidden or 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
- content_for :scripts do | |
= javascript_include_tag "app/application" | |
= javascript_include_tag "app/templates/all" | |
:javascript | |
S.set("quote", S.store.find(S.models.Quote, S.store.load(S.models.Quote, #{QuoteSerializer.new(Quote.find(params[:id])).to_json}.quote).id)); | |
console.log("data loaded") | |
- content_for :sidebar do | |
%script{type:"text/x-handlebars"} | |
{{view S.views.SidebarView}} |
This file contains hidden or 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
Ember.ActiveState = Ember.LayoutState.extend | |
isActive: false | |
enter: (manager, transition)-> | |
@_super(manager, transition) | |
@set("isActive", true) | |
exit: (manager, transition)-> | |
@_super(manager, transition) | |
@set("isActive", false) |
This file contains hidden or 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
// | |
// The logic here is the transitionend event fires instantly | |
// after the transition is done (1ms here). I have seen timeouts | |
// taking up to 300ms to fire (!) so the main avantage is responsiveness. | |
// | |
window.requestTimeout = (function(){ | |
var vendors = 'Webkit Moz O ms Khtml'.split(' '), | |
supports = (function() { | |
var div = document.createElement('div'), | |
len = vendors.length; |
This file contains hidden or 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
class Core::PaginationSerializer < ActiveModel::ArraySerializer | |
def initialize(object, options={}) | |
meta_key = options[:meta_key] || :meta | |
options[meta_key] ||= {} | |
pobject = options[:pagination_object] || object | |
options[meta_key][:pagination] = { | |
current_page: pobject.current_page, | |
next_page: pobject.next_page, |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'th', | |
downArrow: '▼', | |
upArrow: '▲', | |
actions: { | |
sortBy(model, sortProperty, order) { | |
// Remove all selected classes from all the header links |
This file contains hidden or 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
import Ember from 'ember'; | |
class ItemRating extends HTMLElement { | |
createdCallback () { | |
this.insertAdjacentHTML('afterbegin', ` | |
<a data-rating="1">★</a> | |
<a data-rating="2">★</a> | |
<a data-rating="3">★</a> | |
<a data-rating="4">★</a> | |
<a data-rating="5">★</a> |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
building: Ember.computed(function(){ | |
return {id: 1, name: "BUILDING!"} | |
}) | |
}); |
This file contains hidden or 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
const fieldList = [ | |
{ label: 'Foo Fields', fields: [{name: 'foo', selected: false}] }, | |
{ label: 'Bar Fields', fields: [{name: 'bar', selected: true}] } | |
] | |
fields: Ember.computed('[email protected]', function() { | |
return this.get("fieldList").mapBy("fields"); | |
}), | |
enabledFields: Ember.computed("fields", "[email protected]", function(){ |
This file contains hidden or 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
ubuntu@ip-172-31-21-253:/var/deploy/vroom-staging/web_head/releases/20161004023037/front-end$ ./node_modules/.bin/ember build --environment="production" | |
Could not start watchman; falling back to NodeWatcher for file system events. | |
Visit http://ember-cli.com/user-guide/#watchman for more info. | |
⠋ BuildingTorii is installed but not configured in config/environment.js! | |
Build failed. | |
File: assets/vendor.js (123701:7) | |
The Broccoli Plugin: [UglifyWriter] failed with: | |
Error | |
at new JS_Parse_Error (<anonymous>:1545:18) | |
at js_error (<anonymous>:1553:11) |