From 7ed1f2d19fb9e6f6f98b9ab285216cb8f4c74af1 Mon Sep 17 00:00:00 2001 From: Dennis Thompson Date: Sat, 3 Dec 2016 21:09:41 -0800 Subject: [PATCH] Adding icon config --- src/jquery.bootstrap-duallistbox.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/jquery.bootstrap-duallistbox.js b/src/jquery.bootstrap-duallistbox.js index e6c0203..e615b38 100644 --- a/src/jquery.bootstrap-duallistbox.js +++ b/src/jquery.bootstrap-duallistbox.js @@ -26,7 +26,12 @@ eventMoveOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead eventMoveAllOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead eventRemoveOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead - eventRemoveAllOverride: false // boolean, allows user to unbind default event behaviour and run their own instead + eventRemoveAllOverride: false, // boolean, allows user to unbind default event behaviour and run their own instead + iconsPrefix: 'glyphicon', // string, set the icon prefix (e.g. "fa", "glyphicon", etc.) + icons: { // object, set the icon for move and remove operations + move: 'glyphicon-arrow-right', + remove: 'glyphicon-arrow-left' + } }, // Selections are invisible on android if the containing select is styled with CSS // http://code.google.com/p/android/issues/detail?id=16922 @@ -477,16 +482,16 @@ this.container.find('.clear1, .clear2').removeClass('btn-default btn-xs').addClass('btn-mini'); this.container.find('input, select').removeClass('form-control'); this.container.find('.btn').removeClass('btn-default'); - this.container.find('.moveall > i, .move > i').removeClass('glyphicon glyphicon-arrow-right').addClass('icon-arrow-right'); - this.container.find('.removeall > i, .remove > i').removeClass('glyphicon glyphicon-arrow-left').addClass('icon-arrow-left'); + this.container.find('.moveall > i, .move > i').removeClass(this.settings.iconsPrefix + ' ' + this.settings.icons.move).addClass('icon-arrow-right'); + this.container.find('.removeall > i, .remove > i').removeClass(this.settings.iconsPrefix + ' ' + this.settings.icons.remove).addClass('icon-arrow-left'); } else { this.container.removeClass('row-fluid bs2compatible').addClass('row'); this.container.find('.box1, .box2').removeClass('span6').addClass('col-md-6'); this.container.find('.clear1, .clear2').removeClass('btn-mini').addClass('btn-default btn-xs'); this.container.find('input, select').addClass('form-control'); this.container.find('.btn').addClass('btn-default'); - this.container.find('.moveall > i, .move > i').removeClass('icon-arrow-right').addClass('glyphicon glyphicon-arrow-right'); - this.container.find('.removeall > i, .remove > i').removeClass('icon-arrow-left').addClass('glyphicon glyphicon-arrow-left'); + this.container.find('.moveall > i, .move > i').removeClass('icon-arrow-right').addClass(this.settings.iconsPrefix + ' ' + this.settings.icons.move); + this.container.find('.removeall > i, .remove > i').removeClass('icon-arrow-left').addClass(this.settings.iconsPrefix + ' ' + this.settings.icons.remove); } if (refresh) { refreshSelects(this);