Chore: Replaced jQuery.focus() with a focus-on directive

This commit is contained in:
tanshu committed 2015-01-09 12:29:42 +05:30
1 parent e27424c41e
commit e0d3887fa9
70 files changed
+96 -258

No files matched your search

-2
View File
@@ -9,8 +9,6 @@
<meta name="author" content="Tanshu"> <meta name="author" content="Tanshu">
<!-- Le styles --> <!-- Le styles -->
<!-- <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css"/> -->
<link rel="stylesheet" type="text/css" media="screen" href="/css/bootstrap.min.css"/> <link rel="stylesheet" type="text/css" media="screen" href="/css/bootstrap.min.css"/>
<!-- <link rel="stylesheet" type="text/css" media="screen" href="/css/bootstrap-theme.min.css"/> --> <!-- <link rel="stylesheet" type="text/css" media="screen" href="/css/bootstrap-theme.min.css"/> -->
-174
View File
@@ -1,174 +0,0 @@
/*!
* My Custom Stylesheet for
* Bootstrap v2.0.3
*
*/
.thumbnails.small {
margin-left: -50px;
}
.thumbnails.small > li {
float: left;
margin-bottom: 3px;
margin-left: 5px;
}
.thumbnails.small > li > .thumbnail > a {
height: 75px;
width: 75px;
text-align: center;
display: table-cell;
vertical-align: middle;
}
.thumbnails.small > li > .thumbnail > button {
height: 75px;
width: 75px;
text-align: center;
display: table-cell;
vertical-align: middle;
}
.my-markdown {
padding: 3px;
background: #EEE;
border-radius: 3px;
}
.md-title {
font-size: 16px;
line-height: 20px;
font-weight: bold;
padding: 10px 10px;
color: #555;
text-shadow: 1px solid #CACACA;
border-bottom: 0 none;
background-color: #eaeaea;
background-image: linear-gradient(#fafafa, #eaeaea);
background-repeat: repeat-x;
display: block;
}
.md-body {
background-color: #fff;
border: 1px solid #CACACA;
padding: 30px;
font-size: 15px;
line-height: 1.7;
color: #333333;
}
.widget-box {
background: none repeat scroll 0 0 #F9F9F9;
border-top: 1px solid #CDCDCD;
border-left: 1px solid #CDCDCD;
border-right: 1px solid #CDCDCD;
clear: both;
margin-top: 16px;
margin-bottom: 16px;
position: relative;
}
/* widgets from unicorn theme from http://wbpreview.com/previews/WB0F35928/widgets.html */
.widget-title, .modal-header, .table th, div.dataTables_wrapper .ui-widget-header, .ui-dialog .ui-dialog-titlebar {
background-color: #efefef;
background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#fdfdfd), to(#eaeaea));
background-image: -webkit-linear-gradient(top, #fdfdfd 0%, #eaeaea 100%);
border-bottom: 1px solid #CDCDCD;
height: 36px;
}
.widget-title .nav-tabs {
border-bottom: 0 none;
}
.widget-title .nav-tabs li a {
border-bottom: medium none !important;
border-left: 1px solid #DDDDDD;
border-radius: 0 0 0 0;
border-right: 1px solid #DDDDDD;
border-top: medium none;
color: #999999;
margin: 0;
outline: medium none;
padding: 9px 10px 8px;
font-weight: bold;
text-shadow: 0 1px 0 #FFFFFF;
}
.widget-title .nav-tabs li:first-child a {
border-left: medium none !important;
}
.widget-title .nav-tabs li a:hover {
background-color: transparent !important;
border-color: #D6D6D6;
border-width: 0 1px;
color: #666666;
}
.widget-title .nav-tabs li.active a {
background-color: #F9F9F9 !important;
color: #444444;
}
.widget-title span.icon {
border-right: 1px solid #cdcdcd;
padding: 9px 10px 7px 11px;
float: left;
opacity: .7;
}
.widget-title h5 {
color: #666666;
text-shadow: 0 1px 0 #ffffff;
float: left;
font-size: 12px;
font-weight: bold;
padding: 12px;
line-height: 12px;
margin: 0;
}
.widget-title .buttons {
float: right;
margin: 8px 10px 0 0;
}
.widget-title .label {
padding: 3px 5px 2px;
float: right;
margin: 9px 15px 0 0;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 #ffffff;
}
.widget-content {
padding: 12px 15px;
border-bottom: 1px solid #cdcdcd;
}
.widget-box.widget-plain .widget-content {
padding: 12px 0 0;
}
.widget-box.collapsible .collapse.in .widget-content {
border-bottom: 1px solid #CDCDCD;
}
.nopadding {
padding: 0 !important;
}
.nopadding .table {
margin-bottom: 0;
}
.nopadding .table-bordered {
border: 0;
}
.user-info {
color: #666666;
font-size: 11px;
}
+1 -1
View File
@@ -12,7 +12,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="account.Name"/> <input type="text" id="txtName" class="form-control" ng-model="account.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date"/> is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date" focus-on="foDate" />
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" id="txtDate" datepicker-popup="dd-MMM-yyyy" <input type="text" class="form-control" id="txtDate" datepicker-popup="dd-MMM-yyyy"
is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date"/> is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -12,7 +12,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="client.Name"/> <input type="text" id="txtName" class="form-control" ng-model="client.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" id="txtDate" datepicker-popup="dd-MMM-yyyy" <input type="text" class="form-control" id="txtDate" datepicker-popup="dd-MMM-yyyy"
is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date"/> is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
@@ -5,7 +5,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="costCenter.Name"/> <input type="text" id="txtName" class="form-control" ng-model="costCenter.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
@@ -30,7 +30,7 @@
<div class="input-group"> <div class="input-group">
<input type="text" id="txtEmployee" class="form-control" ng-model="info.Employee" <input type="text" id="txtEmployee" class="form-control" ng-model="info.Employee"
typeahead="employee as employee.Name for employee in employees($viewValue)" typeahead="employee as employee.Name for employee in employees($viewValue)"
typeahead-editable="false" on-return="show()"/> typeahead-editable="false" on-return="show()" focus-on="foEmployee"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i> <button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i>
</button> </button>
+1 -1
View File
@@ -12,7 +12,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="employee.Name"/> <input type="text" id="txtName" class="form-control" ng-model="employee.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -5,7 +5,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="group.Name"/> <input type="text" id="txtName" class="form-control" ng-model="group.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -47,7 +47,7 @@
<div class="col-md-5"> <div class="col-md-5">
<input type="text" id="txtBatch" class="form-control" ng-model="batch" <input type="text" id="txtBatch" class="form-control" ng-model="batch"
typeahead="batch as batch.Name for batch in batches($viewValue)" typeahead="batch as batch.Name for batch in batches($viewValue)"
typeahead-editable="false"/> typeahead-editable="false" focus-on="foBatch"/>
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<div class="input-group"> <div class="input-group">
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-10"> <div class="col-md-10">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="dOpen" ng-focus="dOpen = true" ng-model="voucher.Date"/> is-open="dOpen" ng-focus="dOpen = true" ng-model="voucher.Date" focus-on="foAccount"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+2 -2
View File
@@ -30,7 +30,7 @@
<div class="input-group"> <div class="input-group">
<input type="text" id="txtLedger" class="form-control" ng-model="info.Ledger" <input type="text" id="txtLedger" class="form-control" ng-model="info.Ledger"
typeahead="account as account.Name for account in accounts($viewValue)" typeahead="account as account.Name for account in accounts($viewValue)"
typeahead-editable="false" on-return="show()"/> typeahead-editable="false" on-return="show()" focus-on="foLedger"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i> <button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i>
</button> </button>
@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
</div> </div>
<table id="gvGrid" class="table table-condensed table-bordered table-striped" keypress="shortcuts"> <table class="table table-condensed table-bordered table-striped" keypress="shortcuts" focus-on="foGrid">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
+1 -1
View File
@@ -6,7 +6,7 @@
<div class="col-md-10"> <div class="col-md-10">
<input type="text" class="form-control" ng-model="username" id="username" required placeholder="Username" <input type="text" class="form-control" ng-model="username" id="username" required placeholder="Username"
autofocus/> autofocus focus-on="foUsername"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -6,7 +6,7 @@
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtTitle" class="form-control" ng-model="message.Title" <input type="text" id="txtTitle" class="form-control" ng-model="message.Title"
ng-disabled="message.ThreadID"/> ng-disabled="message.ThreadID" focus-on="foTitle"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -30,7 +30,7 @@
<div class="col-md-6"> <div class="col-md-6">
<input type="text" id="txtAccount" class="form-control" ng-model="account" <input type="text" id="txtAccount" class="form-control" ng-model="account"
typeahead="account as account.Name for account in accounts($viewValue)" typeahead="account as account.Name for account in accounts($viewValue)"
typeahead-editable="false"/> typeahead-editable="false" focus-on="foAccount"/>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
+1 -1
View File
@@ -12,7 +12,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="product.Name"/> <input type="text" id="txtName" class="form-control" ng-model="product.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -5,7 +5,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="productGroup.Name"/> <input type="text" id="txtName" class="form-control" ng-model="productGroup.Name" focus-on="foName"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-5"> <div class="col-md-5">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foProduct"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -30,7 +30,7 @@
<div class="col-md-6"> <div class="col-md-6">
<input type="text" id="txtBatch" class="form-control" ng-model="batch" <input type="text" id="txtBatch" class="form-control" ng-model="batch"
typeahead="batch as batch.Name for batch in batches($viewValue)" typeahead="batch as batch.Name for batch in batches($viewValue)"
typeahead-editable="false"/> typeahead-editable="false" focus-on="foBatch"/>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
+1 -1
View File
@@ -29,7 +29,7 @@
<div class="col-md-4"> <div class="col-md-4">
<input type="text" id="txtProduct" class="form-control" ng-model="product" <input type="text" id="txtProduct" class="form-control" ng-model="product"
typeahead="product as product.Name for product in products($viewValue)" typeahead="product as product.Name for product in products($viewValue)"
typeahead-editable="false" on-return="add()"/> typeahead-editable="false" on-return="add()" focus-on="foProduct"/>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input type="text" class="form-control" placeholder="Quantity" ng-model="quantity" on-return="add()"/> <input type="text" class="form-control" placeholder="Quantity" ng-model="quantity" on-return="add()"/>
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -30,7 +30,7 @@
<div class="col-md-6"> <div class="col-md-6">
<input type="text" id="txtAccount" class="form-control" ng-model="account" <input type="text" id="txtAccount" class="form-control" ng-model="account"
typeahead="account as account.Name for account in accounts($viewValue)" typeahead="account as account.Name for account in accounts($viewValue)"
typeahead-editable="false"/> typeahead-editable="false" focus-on="foAccount"/>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
+2 -2
View File
@@ -5,7 +5,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-4"> <div class="col-md-4">
<input type="text" id="txtName" class="form-control" ng-model="recipe.Name"/> <input type="text" id="txtName" class="form-control" ng-model="recipe.Name" focus-on="foName"/>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input type="text" class="form-control" ng-model="recipe.Quantity" placeholder="Quantity"/> <input type="text" class="form-control" ng-model="recipe.Quantity" placeholder="Quantity"/>
@@ -56,7 +56,7 @@
<div class="col-md-5"> <div class="col-md-5">
<input type="text" id="txtProduct" class="form-control" ng-model="product" <input type="text" id="txtProduct" class="form-control" ng-model="product"
typeahead="product as product.Name for product in products($viewValue)" typeahead="product as product.Name for product in products($viewValue)"
typeahead-editable="false" on-return="add()"/> typeahead-editable="false" on-return="add()" focus-on="foProduct"/>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<div class="input-group"> <div class="input-group">
+2 -2
View File
@@ -30,7 +30,7 @@
<div class="input-group"> <div class="input-group">
<input type="text" id="txtLedger" class="form-control" ng-model="info.Account" <input type="text" id="txtLedger" class="form-control" ng-model="info.Account"
typeahead="account as account.Name for account in accounts($viewValue)" typeahead="account as account.Name for account in accounts($viewValue)"
typeahead-editable="false" on-return="show()" typeahead-min-length="0"/> typeahead-editable="false" on-return="show()" typeahead-min-length="0" focus-on="foLedger"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i> <button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i>
</button> </button>
@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
</div> </div>
<table id="gvGrid" class="table table-condensed table-bordered table-striped"> <table class="table table-condensed table-bordered table-striped" focus-on="foGrid">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
+1 -1
View File
@@ -20,7 +20,7 @@
<div class="col-md-5"> <div class="col-md-5">
<input type="text" id="txtEmployee" class="form-control" ng-model="employee" <input type="text" id="txtEmployee" class="form-control" ng-model="employee"
typeahead="employee as employee.Name for employee in employees($viewValue)" typeahead="employee as employee.Name for employee in employees($viewValue)"
typeahead-editable="false"/> typeahead-editable="false" focus-on="foEmployee"/>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input type="text" class="form-control" placeholder="Gross Salary" ng-model="grossSalary"/> <input type="text" class="form-control" placeholder="Gross Salary" ng-model="grossSalary"/>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate"/> is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info.StartDate" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="input-group"> <div class="input-group">
<input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy" <input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy"
is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date"/> is-open="dOpen" ng-focus="dOpen = true" ng-model="info.Date" focus-on="foDate"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button> <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
+1 -1
View File
@@ -5,7 +5,7 @@
<label for="txtName" class="col-md-2 control-label">Name</label> <label for="txtName" class="col-md-2 control-label">Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input type="text" id="txtName" class="form-control" ng-model="user.Name"/> <input type="text" id="txtName" class="form-control" ng-model="user.Name" focus-on="foName"/>
</div> </div>
</div> </div>
+1 -1
View File
@@ -120,7 +120,7 @@ var AccountController = ['$scope', '$location', '$modal', 'account', 'accountTyp
$scope.delete(); $scope.delete();
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
}]; }];
AccountController.resolve = { AccountController.resolve = {
+19
View File
@@ -377,3 +377,22 @@ overlordDirective.directive('fileUpload', function () {
} }
}; };
}); });
overlordDirective.directive('focusOn', ['$timeout', function ($timeout) {
return {
restrict: 'A',
scope: {
focusOn: '='
},
link: function (scope, element, attrs) {
scope.$watch('focusOn', function (value) {
if (value === true) {
//$timeout(function () {
element[0].focus();
scope.focusOn = false;
//});
}
});
}
};
}]);
+1 -1
View File
@@ -15,7 +15,7 @@ var AttendanceController = ['$scope', '$location', 'asDateFilter', 'Attendance',
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtDate').focus(); $scope.foDate = true;
}]; }];
var AttendanceSubController = ['$scope', function ($scope) { var AttendanceSubController = ['$scope', function ($scope) {
+1 -1
View File
@@ -6,7 +6,7 @@ var BalanceSheetController = ['$scope', '$location', 'asDateFilter', 'info', fun
var date = asDate($scope.info.Date); var date = asDate($scope.info.Date);
$location.path('/BalanceSheet/' + date); $location.path('/BalanceSheet/' + date);
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
BalanceSheetController.resolve = { BalanceSheetController.resolve = {
+1 -1
View File
@@ -7,7 +7,7 @@ var CashFlowController = ['$scope', '$routeParams', '$location', 'asDateFilter',
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/CashFlow').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/CashFlow').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
CashFlowController.resolve = { CashFlowController.resolve = {
cashFlow: ['$route', 'CashFlow', function ($route, CashFlow) { cashFlow: ['$route', 'CashFlow', function ($route, CashFlow) {
+1 -1
View File
@@ -51,7 +51,7 @@ var ClientController = ['$scope', '$location', '$modal', 'client', function ($sc
$scope.delete(); $scope.delete();
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
}]; }];
ClientController.resolve = { ClientController.resolve = {
+1 -1
View File
@@ -6,7 +6,7 @@ var ClosingStockController = ['$scope', '$location', 'asDateFilter', 'info', fun
var date = asDate($scope.info.Date); var date = asDate($scope.info.Date);
$location.path('/ClosingStock/' + date); $location.path('/ClosingStock/' + date);
}; };
$('#txtDate').focus(); $scope.foDate = true;
}]; }];
ClosingStockController.resolve = { ClosingStockController.resolve = {
+1 -1
View File
@@ -30,7 +30,7 @@ var CostCenterController = ['$scope', '$routeParams', '$location', 'costCenter',
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
}]; }];
CostCenterController.resolve = { CostCenterController.resolve = {
+1 -1
View File
@@ -7,7 +7,7 @@ var DaybookController = ['$scope', '$location', 'asDateFilter', 'info', function
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/Daybook').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/Daybook').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
DaybookController.resolve = { DaybookController.resolve = {
info: ['$route', 'Daybook', function ($route, Daybook) { info: ['$route', 'Daybook', function ($route, Daybook) {
@@ -28,7 +28,7 @@ var EmployeeAttendanceController = ['$scope', '$location', '$routeParams', 'asDa
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtEmployee').focus(); $scope.foEmployee = true;
}]; }];
var EmployeeAttendanceSubController = ['$scope', function ($scope) { var EmployeeAttendanceSubController = ['$scope', function ($scope) {
+1 -2
View File
@@ -124,8 +124,7 @@ var EmployeeController = ['$scope', '$routeParams', '$location', 'asDateFilter',
$scope.delete(); $scope.delete();
}); });
}; };
$scope.foName = true;
$('#txtName').focus();
}]; }];
EmployeeController.resolve = { EmployeeController.resolve = {
+1 -1
View File
@@ -30,7 +30,7 @@ var GroupController = ['$scope', '$location', 'group', function ($scope, $locati
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
}]; }];
GroupController.resolve = { GroupController.resolve = {
+2 -2
View File
@@ -33,7 +33,7 @@ var IssueController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'v
oldInventory.Quantity += quantity; oldInventory.Quantity += quantity;
delete $scope.batch; delete $scope.batch;
delete $scope.quantity; delete $scope.quantity;
$('#txtBatch').focus(); $scope.foBatch = true;
} }
if (angular.isUndefined(oldInventory) && (!consumption || quantity <= $scope.batch.QuantityRemaining)) { if (angular.isUndefined(oldInventory) && (!consumption || quantity <= $scope.batch.QuantityRemaining)) {
@@ -49,7 +49,7 @@ var IssueController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'v
}); });
delete $scope.batch; delete $scope.batch;
delete $scope.quantity; delete $scope.quantity;
$('#txtBatch').focus(); $scope.foBatch = true;
} }
}; };
$scope.removeInventory = function (inventory) { $scope.removeInventory = function (inventory) {
+2 -2
View File
@@ -1,7 +1,7 @@
'use strict'; 'use strict';
var JournalController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account) { var JournalController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account) {
$('#txtAccount').focus(); $scope.foAccount = true;
$scope.voucher = voucher; $scope.voucher = voucher;
$scope.debit = 1; $scope.debit = 1;
@@ -53,7 +53,7 @@ var JournalController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploa
} }
delete $scope.account; delete $scope.account;
delete $scope.amount; delete $scope.amount;
$('#txtAccount').focus(); $scope.foAccount = true;
}; };
$scope.removeJournal = function (journal) { $scope.removeJournal = function (journal) {
+2 -2
View File
@@ -25,9 +25,9 @@ var LedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', '
}; };
if ($routeParams.id) { if ($routeParams.id) {
$('#gvGrid').focus(); $scope.foGrid = true;
} else { } else {
$('#txtLedger').focus(); $scope.foLedger = true;
} }
$scope.selected = -1; $scope.selected = -1;
+1 -1
View File
@@ -29,7 +29,7 @@ var LoginController = ['$scope', '$http', '$location', '$routeParams', '$cookieS
$scope.toasts.push({Type: 'Danger', Message: data}); $scope.toasts.push({Type: 'Danger', Message: data});
}); });
}; };
$('#username').focus(); $scope.foUsername = true;
}]; }];
var LogoutController = ['$scope', '$http', '$location', function ($scope, $http, $location) { var LogoutController = ['$scope', '$http', '$location', function ($scope, $http, $location) {
+1 -1
View File
@@ -33,7 +33,7 @@ var MessageController = ['$scope', '$location', 'asDateFilter', 'message', 'tags
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtTitle').focus(); $scope.foTitle = true;
}]; }];
MessageController.resolve = { MessageController.resolve = {
+1 -1
View File
@@ -7,7 +7,7 @@ var NetTransactionsController = ['$scope', '$location', 'asDateFilter', 'netTran
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/NetTransactions').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/NetTransactions').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
NetTransactionsController.resolve = { NetTransactionsController.resolve = {
+2 -2
View File
@@ -1,7 +1,7 @@
'use strict'; 'use strict';
var PaymentController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Account) { var PaymentController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Account) {
$('#txtAccount').focus(); $scope.foAccount = true;
$scope.voucher = voucher; $scope.voucher = voucher;
$scope.ledgers = ledgers; $scope.ledgers = ledgers;
@@ -50,7 +50,7 @@ var PaymentController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploa
} }
delete $scope.account; delete $scope.account;
delete $scope.amount; delete $scope.amount;
$('#txtAccount').focus(); $scope.foAccount = true;
}; };
$scope.removeJournal = function (journal) { $scope.removeJournal = function (journal) {
+1 -1
View File
@@ -30,7 +30,7 @@ var ProductGroupController = ['$scope', '$location', 'productGroup', function ($
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
}]; }];
ProductGroupController.resolve = { ProductGroupController.resolve = {
+1 -2
View File
@@ -24,8 +24,7 @@ var ProductLedgerController = ['$scope', '$routeParams', '$location', 'asDateFil
$scope.products = function ($viewValue) { $scope.products = function ($viewValue) {
return Product.autocomplete({term: $viewValue, count: 20}).$promise; return Product.autocomplete({term: $viewValue, count: 20}).$promise;
}; };
$scope.foProduct = true;
$('#txtProduct').focus();
}]; }];
ProductLedgerController.resolve = { ProductLedgerController.resolve = {
productLedger: ['$route', 'ProductLedger', function ($route, ProductLedger) { productLedger: ['$route', 'ProductLedger', function ($route, ProductLedger) {
+1 -2
View File
@@ -128,8 +128,7 @@ var ProductController = ['$scope', '$location', '$window', '$modal', 'product',
$scope.delete(); $scope.delete();
}); });
}; };
$scope.foName = true;
$('#txtName').focus();
}]; }];
ProductController.resolve = { ProductController.resolve = {
+1 -1
View File
@@ -7,7 +7,7 @@ var ProfitLossController = ['$scope', '$location', 'asDateFilter', 'profit_loss'
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/ProfitLoss').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/ProfitLoss').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
ProfitLossController.resolve = { ProfitLossController.resolve = {
+1 -1
View File
@@ -8,7 +8,7 @@ var PurchaseEntriesController = ['$scope', '$location', 'asDateFilter', 'purchas
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/PurchaseEntries').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/PurchaseEntries').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
PurchaseEntriesController.resolve = { PurchaseEntriesController.resolve = {
+1 -2
View File
@@ -53,8 +53,7 @@ var PurchaseReturnController = ['$scope', '$location', 'asDateFilter', '$modal',
}); });
delete $scope.batch; delete $scope.batch;
delete $scope.quantity; delete $scope.quantity;
$('#txtBatch').val(''); $scope.foBatch = true;
$('#txtBatch').focus();
} }
}; };
$scope.removeInventory = function (inventory) { $scope.removeInventory = function (inventory) {
+1 -1
View File
@@ -56,7 +56,7 @@ var PurchaseController = ['$scope', '$location', 'asDateFilter', '$modal', 'uplo
delete $scope.quantity; delete $scope.quantity;
delete $scope.tax; delete $scope.tax;
delete $scope.discount; delete $scope.discount;
$('#txtProduct').focus(); $scope.foProduct = true;
} }
}; };
$scope.removeInventory = function (inventory) { $scope.removeInventory = function (inventory) {
+1 -1
View File
@@ -7,7 +7,7 @@ var RawMaterialCostController = ['$scope', '$location', 'asDateFilter', 'rawMate
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/RawMaterialCost').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/RawMaterialCost').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
RawMaterialCostController.resolve = { RawMaterialCostController.resolve = {
+2 -3
View File
@@ -1,8 +1,7 @@
'use strict'; 'use strict';
var ReceiptController = ['$scope', '$routeParams', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Voucher', 'Account', function ($scope, $routeParams, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Voucher, Account) { var ReceiptController = ['$scope', '$routeParams', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Voucher', 'Account', function ($scope, $routeParams, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Voucher, Account) {
$('#txtAccount').focus(); $scope.foAccount = true;
$scope.voucher = voucher; $scope.voucher = voucher;
$scope.ledgers = ledgers; $scope.ledgers = ledgers;
function getOld(ledgerID, journals) { function getOld(ledgerID, journals) {
@@ -50,7 +49,7 @@ var ReceiptController = ['$scope', '$routeParams', '$location', 'asDateFilter',
} }
delete $scope.account; delete $scope.account;
delete $scope.amount; delete $scope.amount;
$('#txtAccount').focus(); $scope.foAccount = true;
}; };
$scope.removeJournal = function (journal) { $scope.removeJournal = function (journal) {
+2 -2
View File
@@ -69,7 +69,7 @@ var RecipeController = ['$scope', '$location', '$window', '$modal', 'asDateFilte
} }
delete $scope.quantity; delete $scope.quantity;
delete $scope.product; delete $scope.product;
$('#txtProduct').focus(); $scope.foProduct = true;
}; };
$scope.removeItem = function (item) { $scope.removeItem = function (item) {
@@ -155,7 +155,7 @@ var RecipeController = ['$scope', '$location', '$window', '$modal', 'asDateFilte
$scope.delete(); $scope.delete();
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
$scope.products = function ($viewValue) { $scope.products = function ($viewValue) {
return Product.autocomplete({term: $viewValue, count: 20, a: true, e: true, t: 'S'}).$promise; return Product.autocomplete({term: $viewValue, count: 20, a: true, e: true, t: 'S'}).$promise;
+2 -2
View File
@@ -36,9 +36,9 @@ var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter'
}; };
if ($routeParams.id) { if ($routeParams.id) {
$('#gvGrid').focus(); $scope.foGrid = true;
} else { } else {
$('#txtLedger').focus(); $scope.foLedger = true;
} }
$scope.selected = -1; $scope.selected = -1;
+1 -1
View File
@@ -79,7 +79,7 @@ var SalaryDeductionController = ['$scope', '$location', 'asDateFilter', '$modal'
delete $scope.employee; delete $scope.employee;
delete $scope.grossSalary; delete $scope.grossSalary;
delete $scope.daysWorked; delete $scope.daysWorked;
$('#txtEmployee').focus(); $scope.foEmployee = true;
}; };
$scope.remove = function (deduction) { $scope.remove = function (deduction) {
+1 -1
View File
@@ -7,7 +7,7 @@ var StockMovementController = ['$scope', '$location', 'asDateFilter', 'stockMove
finishDate = asDate($scope.info.FinishDate); finishDate = asDate($scope.info.FinishDate);
$location.path('/StockMovement').search({StartDate: startDate, FinishDate: finishDate}); $location.path('/StockMovement').search({StartDate: startDate, FinishDate: finishDate});
}; };
$('#txtStartDate').focus(); $scope.foDate = true;
}]; }];
StockMovementController.resolve = { StockMovementController.resolve = {
+1 -1
View File
@@ -5,7 +5,7 @@ var TrialBalanceController = ['$scope', '$location', 'asDateFilter', 'trialBalan
$scope.show = function () { $scope.show = function () {
$location.path('/TrialBalance/' + asDate($scope.info.Date)); $location.path('/TrialBalance/' + asDate($scope.info.Date));
}; };
$('#txtDate').focus(); $scope.foDate = true;
}]; }];
TrialBalanceController.resolve = { TrialBalanceController.resolve = {
trialBalance: ['$route', 'TrialBalance', function ($route, TrialBalance) { trialBalance: ['$route', 'TrialBalance', function ($route, TrialBalance) {
+1 -1
View File
@@ -30,7 +30,7 @@ var UserController = ['$scope', '$location', 'user', function ($scope, $location
$scope.toasts.push({Type: 'Danger', Message: data.data}); $scope.toasts.push({Type: 'Danger', Message: data.data});
}); });
}; };
$('#txtName').focus(); $scope.foName = true;
}]; }];
UserController.resolve = { UserController.resolve = {