Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
fix: when input was empty, it was filled with the icon prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Aguilar committed Jun 16, 2014
1 parent 60d0e82 commit 225948a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,38 +82,38 @@ Here are all the possibilities in detail:
## Available options

```javascript
var opts = {
title: false, // Popover title (optional) only if specified in the template
selected: false, // use this value as the current item and ignore the original
defaultValue: false, // use this value as the current item if input or element value is empty
placement: 'bottom', // (has some issues with auto and CSS). auto, top, bottom, left, right
collision: 'none', // If true, the popover will be repositioned to another position when collapses with the window borders
animation: true, // fade in/out on show/hide ?
//hide iconpicker automatically when a value is picked. it is ignored if mustAccept is not false and the accept button is visible
hideOnSelect: false,
showFooter: false,
searchInFooter: false, // If true, the search will be added to the footer instead of the title
mustAccept: false, // only applicable when there's an iconpicker-btn-accept button in the popover footer
selectedCustomClass: 'bg-primary', // Appends this class when to the selected item
icons: [], // list of icons (declared at the bottom of this script for maintainability)
iconBaseClass: 'fa', // you can customize class prefix and base name, so you can use other icon fonts like the default Bootstrap's
iconComponentBaseClass: 'fa fa-fw',
iconClassPrefix: 'fa-',
input: 'input', // children input selector
container: false, // Appends the popover to a specific element. If not set, the selected element or element parent is used
component: '.input-group-addon', // children component jQuery selector or object, relative to the container element
// Plugin templates:
templates: {
popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' +
'<div class="popover-title"></div><div class="popover-content"></div></div>',
footer: '<div class="popover-footer"></div>',
buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button>' +
' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',
search: '<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',
iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
iconpickerItem: '<div class="iconpicker-item"><i></i></div>',
}
};
var opts = {
title: false, // Popover title (optional) only if specified in the template
selected: false, // use this value as the current item and ignore the original
defaultValue: false, // use this value as the current item if input or element value is empty
placement: 'bottom', // (has some issues with auto and CSS). auto, top, bottom, left, right
collision: 'none', // If true, the popover will be repositioned to another position when collapses with the window borders
animation: true, // fade in/out on show/hide ?
//hide iconpicker automatically when a value is picked. it is ignored if mustAccept is not false and the accept button is visible
hideOnSelect: false,
showFooter: false,
searchInFooter: false, // If true, the search will be added to the footer instead of the title
mustAccept: false, // only applicable when there's an iconpicker-btn-accept button in the popover footer
selectedCustomClass: 'bg-primary', // Appends this class when to the selected item
icons: [], // list of icons (declared at the bottom of this script for maintainability)
iconBaseClass: 'fa', // you can customize class prefix and base name, so you can use other icon fonts like the default Bootstrap's
iconComponentBaseClass: 'fa fa-fw',
iconClassPrefix: 'fa-',
input: 'input', // children input selector
container: false, // Appends the popover to a specific element. If not set, the selected element or element parent is used
component: '.input-group-addon', // children component jQuery selector or object, relative to the container element
// Plugin templates:
templates: {
popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' +
'<div class="popover-title"></div><div class="popover-content"></div></div>',
footer: '<div class="popover-footer"></div>',
buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button>' +
' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',
search: '<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',
iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
iconpickerItem: '<div class="iconpicker-item"><i></i></div>',
}
};
```

## TO-DO
Expand Down
2 changes: 1 addition & 1 deletion dist/js/fontawesome-iconpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@
},
setSourceValue: function(a) {
a = this.setValue(a);
if (a !== false) {
if (a !== false && a !== "") {
if (this.hasInput()) {
this.input.val(this.getValue());
} else {
Expand Down
Loading

0 comments on commit 225948a

Please sign in to comment.