Gets rid of the forward slash that appears in the enum/set editor when there are no values
This commit is contained in:
@@ -1785,7 +1785,11 @@ $(document).ready(function() {
|
|||||||
// Get the values
|
// Get the values
|
||||||
var values = $(this).parent().prev("input").attr("value").split(",");
|
var values = $(this).parent().prev("input").attr("value").split(",");
|
||||||
$.each(values, function(index, val) {
|
$.each(values, function(index, val) {
|
||||||
|
if(jQuery.trim(val) != "") {
|
||||||
$("#enum_editor #values").append("<input type='text' value=" + val + " />");
|
$("#enum_editor #values").append("<input type='text' value=" + val + " />");
|
||||||
|
} else {
|
||||||
|
$("#enum_editor #values").append("<input type='text' value='' />");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// So we know which column's data is being edited
|
// So we know which column's data is being edited
|
||||||
$("#enum_editor").append("<input type='hidden' value='" + $(this).parent().prev("input").attr("id") + "' />");
|
$("#enum_editor").append("<input type='hidden' value='" + $(this).parent().prev("input").attr("id") + "' />");
|
||||||
@@ -1826,3 +1830,53 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hides certain table structure actions, replacing them with the word "More". They are displayed
|
||||||
|
* in a dropdown menu when the user hovers over the word "More."
|
||||||
|
*/
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Remove the <noscript> icons/text since they aren't needed
|
||||||
|
$("table[id='tablestructure'] td[class='browse'] noscript").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='primary'] noscript").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='unique'] noscript").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='index'] noscript").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='fulltext'] noscript").remove();
|
||||||
|
|
||||||
|
// If the action is enabled (there is a link), wrap the link around the icon and text
|
||||||
|
// (Browse is always enabled)
|
||||||
|
$(".structure_actions_dropdown .action_browse").wrap($("table[id='tablestructure'] td[class='browse'] a").html());
|
||||||
|
|
||||||
|
if($("table[id='tablestructure'] td[class='primary'] a").html()) {
|
||||||
|
$(".structure_actions_dropdown .action_primary ").wrap($("table[id='tablestructure'] td[class='primary'] a").html());
|
||||||
|
}
|
||||||
|
if($("table[id='tablestructure'] td[class='unique'] a").html()) {
|
||||||
|
$(".structure_actions_dropdown .action_unique").wrap($("table[id='tablestructure'] td[class='unique'] a").html());
|
||||||
|
}
|
||||||
|
if($("table[id='tablestructure'] td[class='index'] a").html()) {
|
||||||
|
$(".structure_actions_dropdown .action_index").wrap($("table[id='tablestructure'] td[class='index'] a").html());
|
||||||
|
}
|
||||||
|
if($("table[id='tablestructure'] td[class='fulltext'] a").html()) {
|
||||||
|
$(".structure_actions_dropdown .action_fulltext").wrap($("table[id='tablestructure'] td[class='fulltext'] a").html());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the actions from the table cells
|
||||||
|
$("table[id='tablestructure'] td[class='browse']").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='primary']").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='unique']").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='index']").remove();
|
||||||
|
$("table[id='tablestructure'] td[class='fulltext']").remove();
|
||||||
|
|
||||||
|
// Display the "more" text
|
||||||
|
$("table[id='tablestructure'] td[class='more_opts']").show()
|
||||||
|
|
||||||
|
// When "more" is hovered over, show the hidden actions
|
||||||
|
$("table[id='tablestructure'] td[class='more_opts']").hover(
|
||||||
|
function() {
|
||||||
|
$(this).children(".structure_actions_dropdown").show();
|
||||||
|
},
|
||||||
|
function() {
|
||||||
|
$(this).children(".structure_actions_dropdown").hide();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user