Skip to content

Instantly share code, notes, and snippets.

@bmc08gt
Created January 10, 2014 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmc08gt/8358850 to your computer and use it in GitHub Desktop.
Save bmc08gt/8358850 to your computer and use it in GitHub Desktop.
ul->selector in CSA Edit Page
// ==UserScript==
// @name ul->select
// Written by Brandon McAnsh (C) 2014
// @namespace localhost
// @include https://clientserviceadmin.com/Customer/Edit/*
// @version 1
// @grant none
// ==/UserScript==
$('.nav-list-boxed:nth-child(5)').each(function(){
var list=$(this),
select=$(document.createElement('select')).insertBefore($(this).hide()).change(function(){
window.location.href=$(this).val();
});
$('>li a', this).each(function(){
var option=$(document.createElement('option'))
.appendTo(select)
.val(this.href)
.html($(this).html());
if($(this).attr('class') === 'selected'){
option.attr('selected','selected');
}
});
list.remove();
});
$('form.borderless > div:nth-child(2) > div:nth-child(2) > select:nth-child(5)').css('width', '100%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment