|
2 | 2 | {{#content "description"}}
|
3 | 3 | <p>
|
4 | 4 | Get started with these basic examples, showcasing the different plugin options.
|
5 |
| - You can also view the whole list of <a href="options.js.html">default options here.</a> |
6 |
| - <br> |
7 |
| - Note that all examples are using Bootstrap 4.1.x. |
8 |
| - <br> |
9 |
| - To make them work with Bootstrap 3.x, you basically need to tweak the HTML code by replacing |
10 |
| - `input-group-append` with `input-group-addon`. |
| 5 | + You can also view the whole list of <a href="module-options.html">default options here.</a> |
11 | 6 | </p>
|
12 | 7 | {{/content}}
|
13 | 8 | {{#content "body"}}
|
|
91 | 86 | <p>
|
92 | 87 | Whenever the <code>format</code> option is <var>'auto'</var>, the first parsed color format will be
|
93 | 88 | detected and used as default, but when the option equals <var>null</var> (default),
|
94 |
| - the format is recalculated every time. You can see the differences here, when trying to adjust the alpha |
95 |
| - channel: |
| 89 | + the format is recalculated every time. |
| 90 | + You can see the differences here, one of them allowing you to adjust the alpha channel: |
96 | 91 | </p>
|
97 | 92 | {{/content}}
|
98 | 93 | {{#content "code"}}
|
|
137 | 132 | <script>
|
138 | 133 | $(function () {
|
139 | 134 | $('#cp5c').colorpicker({
|
140 |
| - format: "rgba" |
| 135 | + format: "rgb" |
141 | 136 | });
|
142 | 137 | });
|
143 | 138 | </script>
|
|
277 | 272 |
|
278 | 273 |
|
279 | 274 | {{#extend "example"}}
|
280 |
| - {{#content "title"}} Custom fallback color {{/content}} |
| 275 | + {{#content "title"}} Use a custom fallback color {{/content}} |
281 | 276 | {{#content "description"}}
|
282 | 277 | <p>
|
283 | 278 | Use a predefined fallback color with the <code>fallbackColor</code> option,
|
|
303 | 298 |
|
304 | 299 |
|
305 | 300 | {{#extend "example"}}
|
306 |
| - {{#content "title"}} Invalid color auto-replacement {{/content}} |
| 301 | + {{#content "title"}} Disable invalid color auto replacement {{/content}} |
307 | 302 | {{#content "description"}}
|
308 | 303 | <p>
|
309 | 304 | By default, the <code>autoInputFallback</code> option is enabled, meaning that
|
|
336 | 331 | {{/content}}
|
337 | 332 | {{/extend}}
|
338 | 333 |
|
| 334 | + {{#extend "example"}} |
| 335 | + {{#content "title"}} Adjust the popover options{{/content}} |
| 336 | + {{#content "description"}} |
| 337 | + <p> |
| 338 | + You can use any Bootstrap Popover options (except: trigger, content and html) using the "popover" |
| 339 | + property in the colorpicker options. |
| 340 | + </p> |
| 341 | + {{/content}} |
| 342 | + {{#content "code"}} |
| 343 | + <div id="cp14" class="input-group"> |
| 344 | + <input type="text" class="form-control input-lg" value="hsl(103, 70%, 64%)"/> |
| 345 | + <span class="input-group-append"> |
| 346 | + <span class="input-group-text colorpicker-input-addon"><i></i></span> |
| 347 | + </span> |
| 348 | + </div> |
| 349 | + <script> |
| 350 | + $(function () { |
| 351 | + $('#cp14').colorpicker({ |
| 352 | + popover: { |
| 353 | + title: 'Adjust the color', |
| 354 | + placement: 'top' |
| 355 | + } |
| 356 | + }); |
| 357 | + }); |
| 358 | + </script> |
| 359 | + {{/content}} |
| 360 | + {{/extend}} |
| 361 | + |
| 362 | + {{#extend "example"}} |
| 363 | + {{#content "title"}} Use a color picker inside a modal {{/content}} |
| 364 | + {{#content "description"}}{{/content}} |
| 365 | + {{#content "code"}} |
| 366 | + <!-- Button trigger modal --> |
| 367 | + <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> |
| 368 | + Launch demo modal |
| 369 | + </button> |
| 370 | + |
| 371 | + <!-- Modal --> |
| 372 | + <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" |
| 373 | + aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| 374 | + <div class="modal-dialog" role="document"> |
| 375 | + <div class="modal-content"> |
| 376 | + <div class="modal-header"> |
| 377 | + <h5 class="modal-title" id="exampleModalLabel">Modal title</h5> |
| 378 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| 379 | + <span aria-hidden="true">×</span> |
| 380 | + </button> |
| 381 | + </div> |
| 382 | + <div class="modal-body"> |
| 383 | + <input id="cp15" type="text" class="form-control input-lg" value="rgb(130, 44, 29)"/> |
| 384 | + </div> |
| 385 | + <div class="modal-footer"> |
| 386 | + <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
| 387 | + <button type="button" class="btn btn-primary">Save changes</button> |
| 388 | + </div> |
| 389 | + </div> |
| 390 | + </div> |
| 391 | + </div> |
| 392 | + <script> |
| 393 | + $(function () { |
| 394 | + $('#cp15').colorpicker(); |
| 395 | + }); |
| 396 | + </script> |
| 397 | + {{/content}} |
| 398 | + {{/extend}} |
| 399 | + |
339 | 400 |
|
340 | 401 | {{/content}}
|
341 | 402 | {{/extend}}
|
0 commit comments