U4-1414 - SplitButtons in template editor aren't working

Created by Sebastiaan Janssen 08 Jan 2013, 15:35:37 Updated by Shannon Deminick 17 Jan 2013, 22:40:47

Neither the dropdown for Macro's nor the one for Razor scripts are working.

No JS errors.

Comments

Shannon Deminick 10 Jan 2013, 01:58:18

very odd, i didn't actually change the code for the template editor :P except maybe CSS, will have a look!


Shannon Deminick 10 Jan 2013, 02:58:16

This one is very hard to debug, my first thought was to go back in history to see where anything changed in editTemplate and any JS/Css associated with it and splitbutton but I can't see any changes that would affect this in any way. I've debugged and stepped into the splitbutton.js code (which is really tedious because its obfuscated) and the events are firing on click. It goes so far as to call the jquery UI .menu method to invoke the menu but for some reason the drop down list is not displayed. I've tried to directly edit the css in chrome to make it display and can't even do that. Very strange indeed.


Shannon Deminick 10 Jan 2013, 03:20:17

Ok, found out why it wasn't working. The jquery.splitbutton.js was being loaded too early in the editTemplate.aspx but this was not changed in recent history as far as I can see so this was an absolute major fluke that this ever worked in the first place. Was due to this:

<umb:JsInclude ID="JsInclude" runat="server" FilePath="splitbutton/jquery.splitbutton.js" PathNameAlias="UmbracoClient" Priority="1" />

which sets the priority to "1" which means it will load before many other things including things this library relies on like jquery ui, etc... I have removed the priority which by default makes it 100.


Sebastiaan Janssen 14 Jan 2013, 12:41:23

So the dropdowns do now show, but they don't insert anything. Also the "Insert inline macro" button seems to have disappeared, I suspect it has something to do with these changes as well.


Shannon Deminick 14 Jan 2013, 12:49:39

Really strange, as I mentioned I really haven't changed anything in the template editor and what was there before shouldn't have worked in the first place. Will have a look to see what's up.


esunxray 17 Jan 2013, 10:05:05

How about using Microsoft Ajax Minifier? http://ajaxmin.codeplex.com/


Sebastiaan Janssen 17 Jan 2013, 11:52:37

Fixed in changeset 2afd11749da0 @Shannon you probably meant to move the javascript that I uncommented elsewhere but I'm not sure where, so I left it in editTemplate.aspx for now.


Shannon Deminick 17 Jan 2013, 22:40:47

@Seb no worries about the JS in that file it is old and legacy. Will cleanup with the correct way to do split buttons soon (like it is done in the view editor)


Priority: Major

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.0.0

Due in version: 6.0.0

Sprint:

Story Points:

Cycle: