Skip to content

Commit 1f19354

Browse files
committed
features added (see description), fixes; v1.1.3
beforeOpen, afterOpen, beforeClose, afterClose added
1 parent 41348d5 commit 1f19354

File tree

6 files changed

+72
-43
lines changed

6 files changed

+72
-43
lines changed

css/jquery.scombobox.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@
6060
border-radius: 100px;
6161
color: white;
6262
cursor: pointer;
63-
font-weight: normal;
6463
line-height: 90%;
65-
padding: 0 3px;
64+
padding: 1px 3px 0px;
6665
}
6766
.scombobox-display-div-item-remove:hover {
6867
background: #408CBE;
@@ -157,7 +156,8 @@
157156
cursor: pointer;
158157
}
159158

160-
.scombobox-disabled .scombobox-dropdown-background, .scombobox-disabled .scombobox-dropdown-arrow {
159+
.scombobox-disabled .scombobox-dropdown-background,
160+
.scombobox-disabled .scombobox-dropdown-arrow {
161161
display: none;
162162
}
163163
.scombobox-disabled .scombobox-display-div {

css/jquery.scombobox.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
padding: 0; margin: 0;
1414
}
1515
body {
16-
font-family: 'Arial';
16+
font-family: 'Arial', sans-serif;
1717
font-size: 90%;
1818
color: #333;
1919
line-height: 20px;
@@ -134,7 +134,7 @@
134134
<td>fullMatch</td>
135135
<td>Boolean</td>
136136
<td>Whether to filter the items not only from the beginning of the line. Anyhow, the filtering is applied only in text stored inside of
137-
<code>&lt;span class="dproCombobox-mainspan">&lt;/span></code> element. See also <code>pMarkup</code> and <code>pFillFunc</code></td>
137+
<code>&lt;span class="scombobox-mainspan">&lt;/span></code> element. See also <code>pMarkup</code> and <code>pFillFunc</code></td>
138138
<td><code>false</code></td>
139139
</tr>
140140
<tr>
@@ -187,7 +187,7 @@
187187
<td>forbidInvalid</td>
188188
<td>Boolean</td>
189189
<td>Whether to forbid leaving invalid value in combobox on blur. In case this feature is disabled combobox is highlighted on blur
190-
(<code>dproCombobox-invalid</code> css-class). Other way, the filter text field becomes empty and the combobox value is unset.
190+
(<code>scombobox-invalid</code> css-class). Other way, the filter text field becomes empty and the combobox value is unset.
191191
</td>
192192
<td><code>false</code></td>
193193
</tr>
@@ -221,7 +221,7 @@
221221
<td>pMarkup</td>
222222
<td>String</td>
223223
<td>The paragraph markup. Each item in a list is a paragraph tag.</td>
224-
<td><code>'&lt;img src="${imgsrc}" />&lt;span class="dproCombobox-mainspan">${text}&lt;/span> &lt;span>${additional}&lt;/span>'</code></td>
224+
<td><code>'&lt;img src="${imgsrc}" />&lt;span class="scombobox-mainspan">${text}&lt;/span> &lt;span>${additional}&lt;/span>'</code></td>
225225
</tr>
226226
<tr>
227227
<td>pFillFunc</td>
@@ -257,7 +257,7 @@
257257
<td><code>callback.func</code> executes with arguments <code>callback.args</code>
258258
after every combobox initialization finished. If the target set
259259
contains multiple comboboxes, than callback executes each time. <code>this</code> refers
260-
to the main combobox div (class <code>dproCombobox</code>).</td>
260+
to the main combobox div (class <code>scombobox</code>).</td>
261261
</tr>
262262
</tbody>
263263
<thead>
@@ -274,14 +274,19 @@
274274
<tbody>
275275
<tr>
276276
<td>fill</td>
277-
<td>data {Array|Object|String} data</td>
278-
<td>Fills the combobox with specified data. The data may be represented in the same way as <code>data</code> option.</td>
279-
<td><code>jQuery instance</code></td>
277+
<td>data {Array|Object|String|undefined} data, fill {Boolean} flag</td>
278+
<td>Sets the combobox data. The data may be represented in the same way as <code>data</code> option.
279+
Use <code>fill</code> option to change combobox contents. Using this method without it does not
280+
rebuild the combobox contents.<br />
281+
Despite of having <code>options</code> method described below, this method it useful because
282+
after using <code>options</code> method the data will be merged what may be undesired.
283+
</td>
284+
<td><code>jQuery instance</code> | <code>combobox data</code></td>
280285
</tr>
281286
<tr>
282287
<td>clear</td>
283288
<td></td>
284-
<td>Deletes all the data and clears the combobox.</td>
289+
<td>Empties the combobox. You can still use <code>fill</code> method to get the combobox items back.</td>
285290
<td><code>jQuery instance</code></td>
286291
</tr>
287292
<tr>
@@ -322,9 +327,9 @@
322327
</tr>
323328
<tr>
324329
<td colspan="4">Here are methods which help with working with listeners. To add a listener, use
325-
<code>$(combobox).dproCombobox('lisneter', function(){})</code> syntax. <code>this</code> will refer to different elements depending on event type.
326-
To trigger an event use <code>$(combobox).dproCombobox('lisneter')</code> syntax; to trigger event with a certain namespace, use
327-
<code>$(combobox).dproCombobox('lisneter', 'namespace')</code> syntax.</td>
330+
<code>$(combobox).scombobox('lisneter', function(){})</code> syntax. <code>this</code> will refer to different elements depending on event type.
331+
To trigger an event use <code>$(combobox).scombobox('lisneter')</code> syntax; to trigger event with a certain namespace, use
332+
<code>$(combobox).scombobox('lisneter', 'namespace')</code> syntax.</td>
328333
</tr>
329334
<tr>
330335
<th>Event type</th>
@@ -338,42 +343,62 @@
338343
</tr>
339344
<tr>
340345
<td>focus</td>
341-
<td>&lt;input class="dproCombobox-display" /></td>
346+
<td>&lt;input class="scombobox-display" /></td>
342347
<td colspan="2">On filter input focus. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.td>
343348
</tr>
344349
<tr>
345350
<td>blur</td>
346-
<td>&lt;input class="dproCombobox-display" /></td>
351+
<td>&lt;input class="scombobox-display" /></td>
347352
<td colspan="2">On filter input blur. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.</td>
348353
</tr>
349354
<tr>
350355
<td>keyup</td>
351-
<td>&lt;input class="dproCombobox-display" /></td>
356+
<td>&lt;input class="scombobox-display" /></td>
352357
<td colspan="2">On filter input keyup. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.</td>
353358
</tr>
354359
<tr>
355360
<td>keydown</td>
356-
<td>&lt;input class="dproCombobox-display" /></td>
361+
<td>&lt;input class="scombobox-display" /></td>
357362
<td colspan="2">On filter input keydown. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.</td>
358363
</tr>
359364
<tr>
360365
<td>keypress</td>
361-
<td>&lt;input class="dproCombobox-display" /></td>
366+
<td>&lt;input class="scombobox-display" /></td>
362367
<td colspan="2">On filter input keypress. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.</td>
363368
</tr>
369+
<tr>
370+
<td>beforeOpen</td>
371+
<td>&lt;div class="scombobox"&gt;&lt;/div&gt;</td>
372+
<td colspan="2">This event fires just before div with options slides down.</td>
373+
</tr>
374+
<tr>
375+
<td>beforeClose</td>
376+
<td>&lt;div class="scombobox"&gt;&lt;/div&gt;</td>
377+
<td colspan="2">This event fires just before div with options slides up.</td>
378+
</tr>
379+
<tr>
380+
<td>afterOpen</td>
381+
<td>&lt;div class="scombobox"&gt;&lt;/div&gt;</td>
382+
<td colspan="2">This event fires just after div with options slides down.</td>
383+
</tr>
384+
<tr>
385+
<td>afterClose</td>
386+
<td>&lt;div class="scombobox"&gt;&lt;/div&gt;</td>
387+
<td colspan="2">This event fires just after div with options slides up.</td>
388+
</tr>
364389
<tr>
365390
<td>click</td>
366-
<td>&lt;input class="dproCombobox-display" /></td>
391+
<td>&lt;input class="scombobox-display" /></td>
367392
<td colspan="2">On filter input click. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.</td>
368393
</tr>
369394
<tr>
370395
<td>mousedown</td>
371-
<td>&lt;input class="dproCombobox-display" /></td>
396+
<td>&lt;input class="scombobox-display" /></td>
372397
<td colspan="2">On filter input mousedown. This event does not matter when using 'checkboxes' mode, because this combobox does not have such text field.</td>
373398
</tr>
374399
<tr>
375400
<td>clickDropdown</td>
376-
<td>&lt;div class="dproCombobox-list" /></td>
401+
<td>&lt;div class="scombobox-list" /></td>
377402
<td colspan="2">This event is a click on the dropdown button located in the right corner of a combobox.</td>
378403
</tr>
379404
</tbody>

0 commit comments

Comments
 (0)