Skip to content

Commit d89b6c0

Browse files
committed
Adding "allowedParams" documentation.
1 parent f86ceae commit d89b6c0

6 files changed

+1349
-7
lines changed

www/documentation.html

+20-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="banner clearfix" role="banner">
3535
<p class="title"><span><b>Epoxy</b>.js</span> Elegant Data Binding for Backbone</p>
3636
<div class="download">
37-
<a href="js/backbone.epoxy.min.js" class="download-button">Download Epoxy 1.0.3</a>
37+
<a href="js/backbone.epoxy.min.js" class="download-button">Download Epoxy 1.0.5</a>
3838
<p class="download-info">10k min, 2k gzip <i>|</i> <a href="https://github.com/gmac/backbone.epoxy">GitHub Full Source</a></p>
3939
</div>
4040
</div>
@@ -124,6 +124,7 @@
124124
<ul>
125125
<li><a href="#binding-add-filter">addFilter</a></li>
126126
<li><a href="#binding-add-handler">addHandler</a></li>
127+
<li><a href="#binding-allowed-params">allowedParams</a></li>
127128
<li><a href="#binding-config">config</a></li>
128129
<li><a href="#binding-empty-cache">emptyCache</a></li>
129130
</ul>
@@ -1094,7 +1095,24 @@ <h3 id="binding-add-handler">addHandler</h3>
10941095
<li><tt>handler.clean()</tt> : <i>optional</i>. Called during handler disposal; offers a cleanup hook to remove any custom binding configuration as the handler is deprecated.</li>
10951096
</ul>
10961097
</div>
1097-
1098+
1099+
<div class="section">
1100+
<h3 id="binding-allowed-params">allowedParams</h3>
1101+
<code>Backbone.Epoxy.binding.allowedParams</code>
1102+
<p>A hash defining all non-handler attributes that are allowed within binding declarations. When validating bindings, Epoxy will throw an error for binding declarations that do not have a handler method or an <tt>allowedParams</tt> key. By default, <tt>allowedParams</tt> defines the following allowed keys:</p>
1103+
<ul>
1104+
<li><tt>events</tt></li>
1105+
<li><tt>optionsDefault</tt></li>
1106+
<li><tt>optionsEmpty</tt></li>
1107+
</ul>
1108+
1109+
<p>If you define a custom binding handler that utilizes additional params within the binding declaration, then you must specifically add these additional parameter names into the <tt>allowedParams</tt> hash.</p>
1110+
1111+
<pre><code class="js">Epoxy.binding.allowedParams.myCustomParam = true;</code></pre>
1112+
1113+
<p>In the above example, Epoxy will no longer throw an error when it encounters a <tt>myCustomParam</tt> definition within a binding declaration.</p>
1114+
</div>
1115+
10981116
<div class="section">
10991117
<h3 id="binding-config">config</h3>
11001118
<code>Backbone.Epoxy.binding.config( settings )</code>

www/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div class="banner clearfix" role="banner">
3434
<p class="title"><span><b>Epoxy</b>.js</span> Elegant Data Binding for Backbone</p>
3535
<div class="download">
36-
<a href="js/backbone.epoxy.min.js" class="download-button">Download Epoxy 1.0.3</a>
36+
<a href="js/backbone.epoxy.min.js" class="download-button">Download Epoxy 1.0.5</a>
3737
<p class="download-info">10k min, 2k gzip <i>|</i> <a href="https://github.com/gmac/backbone.epoxy">GitHub Full Source</a></p>
3838
</div>
3939
</div>

0 commit comments

Comments
 (0)