diff --git a/spec/core.spec.js b/spec/core.spec.js index 40ce1b31a..e5e2765de 100644 --- a/spec/core.spec.js +++ b/spec/core.spec.js @@ -115,7 +115,7 @@ describe('Core', function () { jasmine.clock().tick(101); expect(this.$el.find('.medium-insert-buttons').css('display')).toBe('block'); - expect(this.$el.find('.medium-insert-buttons a[data-addon="embeds"]').parent().css('display')).toBe('none'); + expect(this.$el.find('.medium-insert-buttons button[data-addon="embeds"]').parent().css('display')).toBe('none'); }); it('hides plugin\'s buttons after clicking on non-empty paragraph', function () { diff --git a/src/js/core.js b/src/js/core.js index b6b2c4482..2d4a7ec2e 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -440,7 +440,7 @@ if (activeAddon) { $buttons.find('li').hide(); - $buttons.find('a[data-addon="' + activeAddon + '"]').parent().show(); + $buttons.find('button[data-addon="' + activeAddon + '"]').parent().show(); } }; @@ -523,7 +523,7 @@ */ Core.prototype.addonAction = function (e) { - var $a = $(e.target).is('a') ? $(e.target) : $(e.target).closest('a'), + var $a = $(e.currentTarget), addon = $a.data('addon'), action = $a.data('action'); diff --git a/src/js/templates.js b/src/js/templates.js index 18bfb3ff2..27e6827ae 100644 --- a/src/js/templates.js +++ b/src/js/templates.js @@ -4,15 +4,15 @@ this["MediumInsert"]["Templates"] = this["MediumInsert"]["Templates"] || {}; this["MediumInsert"]["Templates"]["src/js/templates/core-buttons.hbs"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function"; - return "