-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efc3c6c
commit 372ea11
Showing
23 changed files
with
5,761 additions
and
1,596 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,16 +1,139 @@ | ||
<!DOCTYPE html> <html> <head> <title>backbone_extensions.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="search_facets.html"> search_facets.js </a> <a class="source" href="search_query.html"> search_query.js </a> <a class="source" href="templates.html"> templates.js </a> <a class="source" href="backbone_extensions.html"> backbone_extensions.js </a> <a class="source" href="hotkeys.html"> hotkeys.js </a> <a class="source" href="inflector.html"> inflector.js </a> <a class="source" href="jquery_extensions.html"> jquery_extensions.js </a> <a class="source" href="search_parser.html"> search_parser.js </a> <a class="source" href="search_box.html"> search_box.js </a> <a class="source" href="search_facet.html"> search_facet.js </a> <a class="source" href="search_input.html"> search_input.js </a> <a class="source" href="visualsearch.html"> visualsearch.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> backbone_extensions.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> | ||
<!DOCTYPE html> | ||
|
||
<span class="kd">var</span> <span class="nx">$</span> <span class="o">=</span> <span class="nx">jQuery</span><span class="p">;</span> <span class="c1">// Handle namespaced jQuery</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>Makes the view enter a mode. Modes have both a 'mode' and a 'group', | ||
<html> | ||
<head> | ||
<title>backbone_extensions.js</title> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> | ||
<link rel="stylesheet" media="all" href="docco.css" /> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<div id="background"></div> | ||
|
||
<ul id="jump_to"> | ||
<li> | ||
<a class="large" href="javascript:void(0);">Jump To …</a> | ||
<a class="small" href="javascript:void(0);">+</a> | ||
<div id="jump_wrapper"> | ||
<div id="jump_page"> | ||
|
||
|
||
<a class="source" href="search_facets.html"> | ||
search_facets.js | ||
</a> | ||
|
||
|
||
<a class="source" href="search_query.html"> | ||
search_query.js | ||
</a> | ||
|
||
|
||
<a class="source" href="templates.html"> | ||
templates.js | ||
</a> | ||
|
||
|
||
<a class="source" href="backbone_extensions.html"> | ||
backbone_extensions.js | ||
</a> | ||
|
||
|
||
<a class="source" href="hotkeys.html"> | ||
hotkeys.js | ||
</a> | ||
|
||
|
||
<a class="source" href="inflector.html"> | ||
inflector.js | ||
</a> | ||
|
||
|
||
<a class="source" href="jquery_extensions.html"> | ||
jquery_extensions.js | ||
</a> | ||
|
||
|
||
<a class="source" href="search_parser.html"> | ||
search_parser.js | ||
</a> | ||
|
||
|
||
<a class="source" href="search_box.html"> | ||
search_box.js | ||
</a> | ||
|
||
|
||
<a class="source" href="search_facet.html"> | ||
search_facet.js | ||
</a> | ||
|
||
|
||
<a class="source" href="search_input.html"> | ||
search_input.js | ||
</a> | ||
|
||
|
||
<a class="source" href="visualsearch.html"> | ||
visualsearch.js | ||
</a> | ||
|
||
</div> | ||
</li> | ||
</ul> | ||
|
||
<ul class="sections"> | ||
|
||
<li id="title"> | ||
<div class="annotation"> | ||
<h1>backbone_extensions.js</h1> | ||
</div> | ||
</li> | ||
|
||
|
||
|
||
<li id="section-1"> | ||
<div class="annotation"> | ||
|
||
<div class="pilwrap "> | ||
<a class="pilcrow" href="#section-1">¶</a> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="content"><div class='highlight'><pre>(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span>{</span> | ||
|
||
<span class="hljs-keyword">var</span> $ = jQuery; <span class="hljs-comment">// Handle namespaced jQuery</span></pre></div></div> | ||
|
||
</li> | ||
|
||
|
||
<li id="section-2"> | ||
<div class="annotation"> | ||
|
||
<div class="pilwrap "> | ||
<a class="pilcrow" href="#section-2">¶</a> | ||
</div> | ||
<p>Makes the view enter a mode. Modes have both a ‘mode’ and a ‘group’, | ||
and are mutually exclusive with any other modes in the same group. | ||
Setting will update the view's modes hash, as well as set an HTML class | ||
of <em>[mode]_[group]</em> on the view's element. Convenient way to swap styles | ||
and behavior.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">setMode</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">mode</span><span class="p">,</span> <span class="nx">group</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="k">this</span><span class="p">.</span><span class="nx">modes</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">modes</span> <span class="o">=</span> <span class="p">{});</span> | ||
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">modes</span><span class="p">[</span><span class="nx">group</span><span class="p">]</span> <span class="o">===</span> <span class="nx">mode</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span> | ||
<span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">el</span><span class="p">).</span><span class="nx">setMode</span><span class="p">(</span><span class="nx">mode</span><span class="p">,</span> <span class="nx">group</span><span class="p">);</span> | ||
<span class="k">this</span><span class="p">.</span><span class="nx">modes</span><span class="p">[</span><span class="nx">group</span><span class="p">]</span> <span class="o">=</span> <span class="nx">mode</span><span class="p">;</span> | ||
<span class="p">};</span> | ||
Setting will update the view’s modes hash, as well as set an HTML class | ||
of <em>[mode]_[group]</em> on the view’s element. Convenient way to swap styles | ||
and behavior.</p> | ||
|
||
<span class="p">})();</span> | ||
</div> | ||
|
||
<div class="content"><div class='highlight'><pre> Backbone.View.prototype.setMode = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(mode, group)</span> {</span> | ||
<span class="hljs-keyword">this</span>.modes || (<span class="hljs-keyword">this</span>.modes = {}); | ||
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.modes[group] === mode) <span class="hljs-keyword">return</span>; | ||
$(<span class="hljs-keyword">this</span>.el).setMode(mode, group); | ||
<span class="hljs-keyword">this</span>.modes[group] = mode; | ||
}; | ||
|
||
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html> | ||
})();</pre></div></div> | ||
|
||
</li> | ||
|
||
</ul> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.