removing fixme from dialogForm function

This commit is contained in:
Ezequiel Bergamaschi 2014-04-16 01:47:40 -03:00
parent 0f3d4856d2
commit 5206d3b627
2 changed files with 5 additions and 8 deletions

View File

@ -78,7 +78,8 @@ jQuery.fn.dialogForm = function (options) {
// Clear form values ... // Clear form values ...
if (options.clearForm == undefined || options.clearForm) { if (options.clearForm == undefined || options.clearForm) {
$("#" + containerId).find('input[name!="color"]').val(''); //FIXME: icon and color should be handled as exceptions..
$("#" + containerId).find('input[name!="color"]input[name!="icon"]').val('');
} }
// Clear button "Saving..." state ... // Clear button "Saving..." state ...
@ -91,12 +92,6 @@ jQuery.fn.dialogForm = function (options) {
formData[elem.name] = elem.value; formData[elem.name] = elem.value;
}); });
// FIX: How should I do this?
var icon = $("#defaultIcon");
if (icon) {
formData["icon"] = icon.find('i').attr('class');
}
// Success actions ... // Success actions ...
var onSuccess = function (jqXHR, textStatus, data) { var onSuccess = function (jqXHR, textStatus, data) {
var resourceId = jqXHR ? jqXHR.getResponseHeader("ResourceId") : undefined; var resourceId = jqXHR ? jqXHR.getResponseHeader("ResourceId") : undefined;
@ -545,6 +540,7 @@ $(function () {
defaultIcon.find("i").remove(); defaultIcon.find("i").remove();
var myClass = $(this).attr("class"); var myClass = $(this).attr("class");
defaultIcon.prepend("<i class='" + myClass +"'></i>"); defaultIcon.prepend("<i class='" + myClass +"'></i>");
defaultIcon.closest("#iconGroup").find('input').val(myClass);
}); });
}); });

View File

@ -353,7 +353,8 @@
</div> </div>
</div> </div>
<div id="iconGroup" class="form-group"> <div id="iconGroup" class="form-group">
<label class="col-md-3 control-label" for="defaultIcon"><spring:message code="ICON"/>:</label> <label class="col-md-3 control-label" for="iconChooser"><spring:message code="ICON"/>:</label>
<input class="form-control" name="icon" id="iconChooser" style="display: none" required="required" value="glyphicon glyphicon-tag"/>
<div class="col-md-1"> <div class="col-md-1">
<div class="btn dropdown-toggle" id="defaultIcon" data-toggle="dropdown"> <div class="btn dropdown-toggle" id="defaultIcon" data-toggle="dropdown">
<i class="glyphicon glyphicon-tag"></i> <i class="glyphicon glyphicon-tag"></i>