New style partially complete
This commit is contained in:
+45
-48
@@ -54,28 +54,30 @@
|
||||
});
|
||||
});
|
||||
|
||||
$("a.qtip-modal").each(function () { bindQtipModal($(this)); });
|
||||
if ($("input#EmployeeName").length > 0) {
|
||||
|
||||
$("input#EmployeeName").after('<span id="icon-employee-history" class="ui-icon ui-icon-search transparent"/>');
|
||||
$("input#EmployeeName")
|
||||
.after('<span id="icon-employee-history" class="add-on"><i class="icon-search" /></span>')
|
||||
.add('#icon-employee-history')
|
||||
.wrapAll('<div class="input-append"></div>');
|
||||
|
||||
function employeeHistoryKeydownHandler(data) {
|
||||
employeeHistoryIconUpdate($(data.target), $("#icon-employee-history"));
|
||||
}
|
||||
function employeeHistoryKeydownHandler(data) {
|
||||
employeeHistoryIconUpdate($(data.target), $("#icon-employee-history"));
|
||||
}
|
||||
|
||||
function employeeHistoryIconUpdate($input, $icon) {
|
||||
if (!$input.hasClass("input-validation-error") // not invalid
|
||||
function employeeHistoryIconUpdate($input, $icon) {
|
||||
if (!$input.hasClass("input-validation-error") // not invalid
|
||||
&& $input.attr("value").length > 0) // has text
|
||||
$icon.removeClass("transparent");
|
||||
else
|
||||
$icon.addClass("transparent");
|
||||
}
|
||||
$icon.removeClass("transparent");
|
||||
else
|
||||
$icon.addClass("transparent");
|
||||
}
|
||||
|
||||
$("input#EmployeeName").change(employeeHistoryKeydownHandler).keydown(employeeHistoryKeydownHandler);
|
||||
$("input#EmployeeName").change(employeeHistoryKeydownHandler).keydown(employeeHistoryKeydownHandler);
|
||||
|
||||
if ($("input#EmployeeName").length > 0)
|
||||
employeeHistoryIconUpdate($("input#EmployeeName"), $("#icon-employee-history"));
|
||||
|
||||
$("#icon-employee-history").qtip({
|
||||
$("#icon-employee-history").qtip({
|
||||
content: {
|
||||
text: "<p class=\"loading\">Recent Logs...</p>",
|
||||
},
|
||||
@@ -88,11 +90,11 @@
|
||||
delay: 500
|
||||
},
|
||||
events: {
|
||||
show: function (event, api) {
|
||||
show: function(event, api) {
|
||||
$.ajax({
|
||||
url: "CreateLog/RecentLogs",
|
||||
data: {
|
||||
employeeName: $("input#EmployeeName").val()
|
||||
employeeName: $("input#EmployeeName").val()
|
||||
},
|
||||
success: function(data) {
|
||||
api.set("content.text", data);
|
||||
@@ -101,40 +103,39 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ($('input#VehicleId').length > 0) {
|
||||
// var settings = $('form').validate().settings;
|
||||
|
||||
// settings.onkeyup = false;
|
||||
// settings.onfocusout = function (element) { $(element).valid(); };
|
||||
|
||||
// var oldSuccessFunction = settings.success;
|
||||
|
||||
// settings.success = function (label) {
|
||||
// alert("success");
|
||||
|
||||
// oldSuccessFunction(label);
|
||||
// };
|
||||
}
|
||||
|
||||
// Convert MVC3 WebGrid paging to Bootstrap
|
||||
var $paging = $('table.table tfoot tr td');
|
||||
|
||||
var $currentPage =
|
||||
$paging.contents()
|
||||
.filter(function () { return this.nodeType == 3 && this.length != 1; });
|
||||
var $otherPages = $('a', $paging);
|
||||
|
||||
if ($paging.length == 1 && $otherPages.length > 0) {
|
||||
$currentPage.wrap('<li class="active"><a href="#">');
|
||||
$otherPages.wrap('<li>');
|
||||
$('li', $paging).wrapAll('<div class="pagination"><ul>');
|
||||
}
|
||||
|
||||
// Add active class to nav
|
||||
var h = { 'log-nav': /\/log/i, 'vehicle-nav': /\/vehicle/i };
|
||||
$.each(h, function(id, regex) {
|
||||
if (regex.test(document.URL)) {
|
||||
$("#" + id).addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
// add qtip
|
||||
$("a.qtip-modal").each(function () { bindQtipModal($(this)); });
|
||||
});
|
||||
|
||||
function bindQtipModal(element) {
|
||||
var corner = {
|
||||
target: 'top left',
|
||||
tooltip: 'bottom center'
|
||||
};
|
||||
var tip = 'bottom left';
|
||||
if (element.hasClass("below")) {
|
||||
corner = {
|
||||
target: 'bottom middle',
|
||||
tooltip: 'top right'
|
||||
};
|
||||
tip = 'top right';
|
||||
}
|
||||
|
||||
element.click(function () { return false; });
|
||||
|
||||
element.append('<span class="ui-icon ui-icon-triangle-1-n"/>');
|
||||
element.append(' <i class="icon-chevron-up" />');
|
||||
|
||||
element.qtip({
|
||||
content: {
|
||||
@@ -147,12 +148,8 @@ function bindQtipModal(element) {
|
||||
fixed: true,
|
||||
delay: 500
|
||||
},
|
||||
position: {
|
||||
corner: corner
|
||||
},
|
||||
style: {
|
||||
classes: 'qtip-light',
|
||||
tip: tip,
|
||||
classes: 'qtip-light qtip-shadow',
|
||||
width: 300
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user