Created
January 10, 2014 17:37
-
-
Save bmc08gt/8358850 to your computer and use it in GitHub Desktop.
ul->selector in CSA Edit Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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