From 5c2fe2ffbce4e8c75f68a1035ff8795558a40853 Mon Sep 17 00:00:00 2001 From: Josh Angell Date: Wed, 4 Jul 2018 15:43:50 +0100 Subject: [PATCH 1/3] Add `typeChange` event to `Craft.EntryTypeSwitcher` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows plugins to listen to the event and do things when the entry type is switched e.g. `Garnish.on(Craft.EntryTypeSwitcher, 'typeChange', function() {…});` --- src/web/assets/editentry/dist/EntryTypeSwitcher.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/web/assets/editentry/dist/EntryTypeSwitcher.js b/src/web/assets/editentry/dist/EntryTypeSwitcher.js index 7ecd0e63f68..589fab4d569 100644 --- a/src/web/assets/editentry/dist/EntryTypeSwitcher.js +++ b/src/web/assets/editentry/dist/EntryTypeSwitcher.js @@ -38,6 +38,8 @@ if (typeof slugGenerator !== 'undefined') { slugGenerator.setNewSource('#title'); } + + this.trigger('typeChange'); } }, this)); } From f2cd65208c514341aad51bef77ac9a7dd76f05ee Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Thu, 5 Jul 2018 01:37:09 +0200 Subject: [PATCH 2/3] grunt --- src/web/assets/editentry/dist/EntryTypeSwitcher.min.js | 2 +- src/web/assets/editentry/dist/EntryTypeSwitcher.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/assets/editentry/dist/EntryTypeSwitcher.min.js b/src/web/assets/editentry/dist/EntryTypeSwitcher.min.js index 3b5e5122e9c..99baf52b00f 100644 --- a/src/web/assets/editentry/dist/EntryTypeSwitcher.min.js +++ b/src/web/assets/editentry/dist/EntryTypeSwitcher.min.js @@ -1,2 +1,2 @@ -!function(i){Craft.EntryTypeSwitcher=Garnish.Base.extend({$typeSelect:null,$spinner:null,init:function(){this.$typeSelect=i("#entryType"),this.$spinner=i('