Skip to content

Commit 5ec029b

Browse files
committed
Fixed some typos in README, updated docs
1 parent a0f39aa commit 5ec029b

File tree

3 files changed

+159
-154
lines changed

3 files changed

+159
-154
lines changed

.publish

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 90f7c686ddfba724490eccf0b0763d05cd6127cf

README.md

Lines changed: 157 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -230,158 +230,163 @@ $(function(){
230230

231231
##Options:
232232

233-
<table>
234-
<tr>
235-
<td><strong>Option</strong></td>
236-
<td><strong>Default</strong></td>
237-
<td><strong>Type</strong></td>
238-
<td><strong>Description</strong></td>
239-
</tr>
240-
<tr>
241-
<td>onBeforeInit</td>
242-
<td>function(element) {}</td>
243-
<td>Function</td>
244-
<td>Function called before plugin initialize</td>
245-
</tr>
246-
<tr>
247-
<td>onInit</td>
248-
<td>function(element) {}</td>
249-
<td>Function</td>
250-
<td>Function called plugin has been fully initialized</td>
251-
</tr>
252-
<tr>
253-
<td>onBeforeOpen</td>
254-
<td>function(element) {}</td>
255-
<td>Function</td>
256-
<td>Function called before select options opens</td>
257-
</tr>
258-
<tr>
259-
<td>onOpen</td>
260-
<td>function(element) {}</td>
261-
<td>Function</td>
262-
<td>Function called after select options opens</td>
263-
</tr>
264-
<tr>
265-
<td>onBeforeClose</td>
266-
<td>function(element) {}</td>
267-
<td>Function</td>
268-
<td>Function called before select options closes</td>
269-
</tr>
270-
<tr>
271-
<td>onClose</td>
272-
<td>function(element) {}</td>
273-
<td>Function</td>
274-
<td>Function called after select options closes</td>
275-
</tr>
276-
<tr>
277-
<td>onBeforeChange</td>
278-
<td>function(element) {}</td>
279-
<td>Function</td>
280-
<td>Function called before select options change</td>
281-
</tr>
282-
<tr>
283-
<td>onChange</td>
284-
<td>function(element) {
285-
&nbsp;&nbsp;$(element).change();
286-
}</td>
287-
<td>Function</td>
288-
<td>Function called when select options change</td>
289-
</tr>
290-
<tr>
291-
<td>onRefresh</td>
292-
<td>function(element) {}</td>
293-
<td>Function</td>
294-
<td>Function called when the Selectric is refreshed</td>
295-
</tr>
296-
<tr>
297-
<td>maxHeight</td>
298-
<td>300</td>
299-
<td>Integer</td>
300-
<td>Maximum height options box can be</td>
301-
</tr>
302-
<tr>
303-
<td>keySearchTimeout</td>
304-
<td>500</td>
305-
<td>Integer</td>
306-
<td>After this time without pressing any key, the search string is reset</td>
307-
</tr>
308-
<tr>
309-
<td>arrowButtonMarkup</td>
310-
<td>&lt;b class=&quot;button&quot;&gt;&amp;#9662;&lt;/b&gt;</td>
311-
<td>String [HTML]</td>
312-
<td>Markup for open options button</td>
313-
</tr>
314-
<tr>
315-
<td>disableOnMobile</td>
316-
<td>true</td>
317-
<td>Boolean</td>
318-
<td>Initialize plugin on mobile browsers</td>
319-
</tr>
320-
<tr>
321-
<td>openOnHover</td>
322-
<td>false</td>
323-
<td>Boolean</td>
324-
<td>Open select box on hover, instead of click</td>
325-
</tr>
326-
<tr>
327-
<td>hoverIntentTimeout</td>
328-
<td>500</td>
329-
<td>Integer</td>
330-
<td>Timeout to close options box after mouse leave plugin area</td>
331-
</tr>
332-
<tr>
333-
<td>expandToItemText</td>
334-
<td>false</td>
335-
<td>Boolean</td>
336-
<td>Expand options box past wrapper</td>
337-
</tr>
338-
<tr>
339-
<td>responsive</td>
340-
<td>false</td>
341-
<td>Boolean</td>
342-
<td>The select element become responsive</td>
343-
</tr>
344-
<tr>
345-
<td>customClass</td>
346-
<td>{
347-
&nbsp;&nbsp;prefix: 'selectric',
348-
&nbsp;&nbsp;postfixes: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above Scroll',
349-
&nbsp;&nbsp;camelCase: true,
350-
&nbsp;&nbsp;overwrite: true
351-
}</td>
352-
<td>Object</td>
353-
<td>Custom classes.
354-
Every class in 'postfixes' should be separate with a space and follow this exact order: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above Scroll'</td>
355-
</tr>
356-
<tr>
357-
<td>optionsItemBuilder</td>
358-
<td>'{text}'</td>
359-
<td>String or Function</td>
360-
<td>Define how each option should be rendered inside its &lt;li&gt; element.
361-
362-
If it's a string, all keys wrapped in brackets will be replaced by the respective values in itemData. Available keys are: 'value', 'text', 'slug', 'disabled'.
363-
364-
If it's a function, it will be called with the following parameters: (itemData, element, index). The function must return a string, no keys will be replaced in this method.</td>
365-
</tr>
366-
<tr>
367-
<td>preventWindowScroll</td>
368-
<td>true</td>
369-
<td>Boolean</td>
370-
<td>Prevent scroll on window when using mouse wheel inside options box to match common browsers behavior.</td>
371-
</tr>
372-
<tr>
373-
<td>inheritOriginalWidth</td>
374-
<td>false</td>
375-
<td>Boolean</td>
376-
<td>Inherit width from original element</td>
377-
</tr>
378-
<tr>
379-
<td>allowWrap</td>
380-
<td>true</td>
381-
<td>Boolean</td>
382-
<td>Determine if current selected option should jump to first (or last) once reach the end (of start) item of list upon keyboard arrow navigation.</td>
383-
</tr>
384-
</table>
233+
```js
234+
{
235+
/*
236+
* Type: Function
237+
* Description: Function called before plugin initialize
238+
*/
239+
onBeforeInit: function() {},
240+
241+
/*
242+
* Type: Function
243+
* Description: Function called plugin has been fully initialized
244+
*/
245+
onInit: function() {},
246+
247+
/*
248+
* Type: Function
249+
* Description: Function called plugin has been fully initialized
250+
*/
251+
onBeforeOpen: function() {},
252+
253+
/*
254+
* Type: Function
255+
* Description: Function called after select options opens
256+
*/
257+
onOpen: function() {},
258+
259+
/*
260+
* Type: Function
261+
* Description: Function called before select options closes
262+
*/
263+
onBeforeClose: function() {},
264+
265+
/*
266+
* Type: Function
267+
* Description: Function called after select options closes
268+
*/
269+
onClose: function() {},
270+
271+
/*
272+
* Type: Function
273+
* Description: Function called before select options change
274+
*/
275+
onBeforeChange: function() {},
276+
277+
/*
278+
* Type: Function
279+
* Description: Function called when select options change
280+
*/
281+
onChange: function(element) {
282+
$(element).change();
283+
},
284+
285+
/*
286+
* Type: Function
287+
* Description: Function called when the Selectric is refreshed
288+
*/
289+
onRefresh: function() {},
290+
291+
/*
292+
* Type: Integer
293+
* Description: Maximum height options box can be
294+
*/
295+
maxHeight: 300,
296+
297+
/*
298+
* Type: Integer
299+
* Description: After this time without pressing
300+
* any key, the search string is reset
301+
*/
302+
keySearchTimeout: 500,
303+
304+
/*
305+
* Type: String [HTML]
306+
* Description: Markup for open options button
307+
*/
308+
arrowButtonMarkup: '<b class="button">&#x25be;</b>',
309+
310+
/*
311+
* Type: Boolean
312+
* Description: Initialize plugin on mobile browsers
313+
*/
314+
disableOnMobile: true,
315+
316+
/*
317+
* Type: Boolean
318+
* Description: Open select box on hover, instead of click
319+
*/
320+
openOnHover: false,
321+
322+
/*
323+
* Type: Integer
324+
* Description: Timeout to close options box after mouse leave plugin area
325+
*/
326+
hoverIntentTimeout: 500,
327+
328+
/*
329+
* Type: Boolean
330+
* Description: Expand options box past wrapper
331+
*/
332+
expandToItemText: false,
333+
334+
/*
335+
* Type: Boolean
336+
* Description: The select element become responsive
337+
*/
338+
responsive: false,
339+
340+
/*
341+
* Type: Object
342+
* Description: Customize classes.
343+
* Every class in 'postfixes' should be separate with a
344+
* space and follow this exact order:
345+
* 'Input Items Open Disabled TempShow HideSelect Wrapper
346+
* Hover Responsive Above Scroll Group GroupLabel'
347+
*/
348+
customClass: {
349+
prefix: 'selectric',
350+
camelCase: false,
351+
overwrite: true
352+
},
353+
354+
/*
355+
* Type: String or Function
356+
* Description: Define how each option should be rendered inside its <li> element.
357+
*
358+
* If it's a string, all keys wrapped in brackets will be replaced by
359+
* the respective values in itemData. Available keys are:
360+
* 'value', 'text', 'slug', 'disabled'.
361+
*
362+
* If it's a function, it will be called with the following parameters:
363+
* (itemData, element, index). The function must return a string,
364+
* no keys will be replaced in this method.
365+
*/
366+
optionsItemBuilder: '{text}',
367+
368+
/*
369+
* Type: Boolean
370+
* Description: Prevent scroll on window when using mouse wheel inside options box
371+
* to match common browsers behavior.
372+
*/
373+
preventWindowScroll: true,
374+
375+
/*
376+
* Type: Boolean
377+
* Description: Inherit width from original element
378+
*/
379+
inheritOriginalWidth: false,
380+
381+
/*
382+
* Type: Boolean
383+
* Description: Determine if current selected option should jump to
384+
* first (or last) once reach the end (or start) item of list upon
385+
* keyboard arrow navigation.
386+
*/
387+
allowWrap: false
388+
}
389+
```
385390

386391
##Events:
387392

src/jquery.selectric.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
allowWrap: true,
2020
customClass: {
2121
prefix: pluginName,
22-
postfixes: 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above Scroll Group GroupLabel',
2322
camelCase: false,
2423
overwrite: true
2524
},
@@ -123,7 +122,7 @@
123122
postfixes = customClass.postfixes.split(' '),
124123
originalWidth = $original.width();
125124

126-
$.each(postfixes, function(i, elm) {
125+
$.each(classList, function(i, elm) {
127126
var c = customClass.prefix + postfixes[i];
128127
_this.classes[elm.toLowerCase()] = customClass.camelCase ? c : _utils.toDash(c);
129128
});

0 commit comments

Comments
 (0)