victor-valencia / bootstrap-iconpicker

A simple icon picker
https://victor-valencia.github.com/bootstrap-iconpicker/
MIT License
378 stars 140 forks source link

Navigation Arrows Broken When Using Fon tAwesome #9

Closed NotNormal closed 9 years ago

NotNormal commented 10 years ago

You shouldn't require glyphicon be included in a page that wants a selector for Font Awesome icons. I modified the createButtonBar function as follows: Iconpicker.prototype.createButtonBar = function(){
... var btn = $('<button class="btn btn-primary"><span class="glyphicon"></span></button>'); if (op.iconset === "fontawesome") { btn.children().attr("class", "fontawesome") } var td = $('<td class="text-center"></td>'); if(i == 0 || i == op.cols - 1){
... btn.addClass((i==0) ? 'btn-previous': 'btn-next'); if (op.iconset === "fontawesome") { btn.find('span').addClass( (i == 0) ? 'fa fa-arrow-left': 'fa fa-arrow-right'); } else { btn.find('span').addClass( (i == 0) ? 'glyphicon-arrow-left': 'glyphicon-arrow-right'); } ... };

This change allows the icons diplayed for navigation to be the same as the iconset the selector is being used for.

victor-valencia commented 10 years ago

Is correct modification mentioned, one need only note that the bootstrap version 3 includes glypicons by default.

Please note that this project is for Bootstrap 3, including Glyphicons or Font Awesome Icons .