Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Forked from getify/gist:482494
Created July 20, 2010 04:45
Show Gist options
  • Save unscriptable/482544 to your computer and use it in GitHub Desktop.
Save unscriptable/482544 to your computer and use it in GitHub Desktop.
cujo.js equivalent (in-browser):
file: myApp.view.LoginPanel.html
<div class="myapp-view-loginpanel">
<span data-attach="greeting">${display.greeting}</span>
<a data-attach="action" href="{$config.loginUrl}">{$display.loginAction}</a>
</div>
logout version extends login version (inheritance defined in myApp.view.LogoutPanel.js:
file: myApp.view.LogoutPanel.html
<div data-cujo="{inherit:true}" class="myapp-view-logoutpanel" data-override="mixin">
<a data-attach="action" href="{$config.logoutUrl}" data-override="mixin">{$display.logoutAction}</a>
</div>
When LogoutPanel overrides LoginPanel, the final output looks like this (sample data and i18n strings included for completeness):
<div data-cujo="{inherit:true}" class="myapp-view-loginpanel myapp-view-logoutpanel" data-override="mixin">
<span data-attach="greeting">Hello, Tommy!</span>
<a data-attach="action" href="/logout/" data-override="mixin">logout</a>
</div>
Notice that the class attributes were combined to allow OOCSS "inheritance".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy