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 current context | |
| The value of `this` in a javascript function call depends on the *execution context* of the function. If we take the above execution of `Simple()` but exclude the new keyword, | |
| `this` would refer to the global object and the `name` property would be added to that object. In a browser the global object is `window`, so in this example, name would be a property of | |
| the `window` object: | |
| ``` javascript | |
| Simple(); | |
| console.log(window.name); | |
| => "Adam" |
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
| __extends = function(child, parent) { | |
| __hasProp = {}.hasOwnProperty | |
| for (var key in parent) { | |
| if (__hasProp.call(parent, key)) | |
| child[key] = parent[key]; | |
| } | |
| function ctor() { | |
| this.constructor = child; |
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
| %header{class: topic.cover_image? ? 'coverimage' : ''} | |
| -if topic.cover_image? | |
| %figure.img-canvas-small | |
| =image_tag(comment.topic.cover_image) | |
| -# I want this execute seperately, but nested in header | |
| %article | |
| %h2 | |
| -if comment.conversation.subject? | |
| %a.title{ href: conversation_path(comment.conversation, anchor: comment.id.to_s), 'data-pjax' => '#container' } |
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
| // specify it under conversation style | |
| .conversation { | |
| header { | |
| padding-top: 12px; | |
| padding-bottom: 12px; | |
| } | |
| } | |
| // specify it explicitly | |
| header.single-line { |
NewerOlder