Comments on: Highlight Selected Navigation Module https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/ ServiceNow Consulting Scripting Administration Development Thu, 07 Mar 2024 15:25:47 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Sai https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8877 Wed, 27 Jun 2018 09:26:28 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8877 @sannthosh

Did you solve the same for UI16

]]>
By: Sannthosh https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8875 Tue, 23 May 2017 15:53:15 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8875 In reply to Dylan Lindgren.

Hello Dylan,

This is indeed a very helpful UI Script!

By any chance have you made a similar script that works in UI16 as well?

Thanks a lot in advance!

]]>
By: Mark Stanger https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8874 Tue, 28 Jul 2015 02:59:52 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8874 In reply to Dylan Lindgren.

Awesome, thanks for the update. Please keep me posted on how this performs after it’s been out in the wild for a few months. If it’s stable I’ll probably just use this as the core solution once Fuji is being used by more companies.

]]>
By: Dylan Lindgren https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8873 Tue, 28 Jul 2015 02:33:54 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8873 The script mentioned doesn’t seem to be working in UI15 (Fuji), and so I reworked the script using jQuery, tested, and got it working!
_______

// This is the colour of the background of the most recent selected item
// since the Application Navigator was loaded
var RECENT_SELECTION = "#4bd762";

// This is the colour of the background of items that have been selected
// at least once since the Application Navigator was loaded
var PAST_SELECTION = "transparent";

// This variable will contain the last-selected nav item so that
// it can be easily modified once the next item is selected
var lastSelectedNavItem;

function highlightSelectedNavItems() {

	try {
		var $j = jQuery.noConflict();

		// Once the Application Navigator iFrame has loaded, add an on-click
		// event to call the selectItem function
		$j("#gsft_nav").load(function(){
			$j("#gsft_nav").contents()
				.find(".nav_menu_header")
				.click(selectItem);
		});

	} catch(e) {}

	var selectItem = function () {

		// If an item is already highlighted, change it's background colour to
		// that of past selections.
		if (lastSelectedNavItem != undefined) {
			lastSelectedNavItem.css("background-color", PAST_SELECTION);
		}

		// We want to apply the background colour to the entire
		// module, not just the link we clicked
		lastSelectedNavItem = $j(this).parent('.app_module');

		// Set the background colour of the clicked item to that
		// of recent selections.
		lastSelectedNavItem.css("background-color", RECENT_SELECTION);
	}
}

addLoadEvent(highlightSelectedNavItems);
]]>
By: Raghu https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8872 Thu, 29 Jan 2015 09:56:30 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8872 Superrrr it works now… Thanks Mark :)

]]>
By: Mark Stanger https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8871 Wed, 28 Jan 2015 12:14:07 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8871 In reply to Raghu.

Thanks for the tip! UI14 (which is the UI used in Eureka instances of ServiceNow and beyond) changes the menu structure a bit. I’ve updated the script above with a fix. Give that a try and let me know how it works for you.

]]>
By: Raghu https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8870 Wed, 28 Jan 2015 06:49:04 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8870 Hi Mark,

This feature looks cool and BTW I just tried to implement this in Eureka instance it is not working. Do you have any idea is their any restrictions of this code usability in Eureka instance?

Thank you…

Regards,
Raghu

]]>
By: Roger Metcalf https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8869 Tue, 17 Jun 2014 14:40:19 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8869 In reply to Jeff.

I found the same: that it doesn’t work in Berlin unless I impersonate a different user. Then noticed: If I “Switch to old UI” it works, “Switch to new UI” it doesn’t, whatever the user. And when I impersonate a different user, I start out with the old UI (so it works).

]]>
By: Jeff https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8868 Thu, 16 May 2013 17:56:57 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8868 In reply to Mark Stanger.

The user preferences did the trick, I deleted them and now working for my user log in as well Thanks Mark!!!!!!

]]>
By: Mark Stanger https://servicenowguru.com/ui-scripts-system-ui/highlight-selected-navigation-module/#comment-8867 Thu, 16 May 2013 17:49:34 +0000 https://servicenowguru.wpengine.com/?p=4000#comment-8867 In reply to Jeff.

No idea other than differences between your preferences and a user that isn’t having the problem. User preferences really aren’t a big deal so you could even delete all of your preferences if you wanted to check quickly. Export your user preferences to XML first if you want to have a backup that you can re-import if necessary.

]]>