From c7747b3c30b2ea6639208bb7bb535996dec1448a Mon Sep 17 00:00:00 2001 From: Sulka Haro Date: Sun, 27 Sep 2015 17:19:09 +0300 Subject: [PATCH 1/2] Should fix iOS converting the direction arrows to Emoji on most iOS versions. --- lib/plugins/direction.js | 4 ++-- lib/plugins/pluginbase.js | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/plugins/direction.js b/lib/plugins/direction.js index f3698664fc4..07f9f6e1071 100644 --- a/lib/plugins/direction.js +++ b/lib/plugins/direction.js @@ -34,8 +34,8 @@ function init() { } sbx.pluginBase.updatePillText(direction, { - label: prop && prop.label - , directText: true + label: prop && prop.label + '︎' + , directHTML: true }); } }; diff --git a/lib/plugins/pluginbase.js b/lib/plugins/pluginbase.js index fe00b805082..eed09d50f32 100644 --- a/lib/plugins/pluginbase.js +++ b/lib/plugins/pluginbase.js @@ -61,16 +61,19 @@ function init (majorPills, minorPills, statusPills, bgStatus, tooltip) { pill.addClass(options.pillClass); - if (options.directText) { - pill.text(options.label); + if (options.directHTML) { + pill.html(options.label); } else { - pill.find('label').attr('class', options.labelClass).text(options.label); - - pill.find('em') - .attr('class', options.valueClass) - .toggle(options.value != null) - .text(options.value) - ; + if (options.directText) { + pill.text(options.label); + } else { + pill.find('label').attr('class', options.labelClass).text(options.label); + pill.find('em') + .attr('class', options.valueClass) + .toggle(options.value != null) + .text(options.value) + ; + } } if (options.info && options.info.length) { From 836ed35a71f49c5bc46ef14fc65ea4b1c16076c4 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Sun, 27 Sep 2015 10:01:12 -0700 Subject: [PATCH 2/2] expect the iOS ︎ hack after the direction arrow --- tests/direction.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/direction.test.js b/tests/direction.test.js index 472858b6575..bf421795d01 100644 --- a/tests/direction.test.js +++ b/tests/direction.test.js @@ -47,7 +47,7 @@ describe('BG direction', function ( ) { it('set a pill to the direction', function (done) { var pluginBase = { updatePillText: function mockedUpdatePillText (plugin, options) { - options.label.should.equal('→'); + options.label.should.equal('→︎'); done(); } };