Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
added jquery dependency to package.json,
updated readme.md,
added support for form fields without label (.w2ui-span0),
fixed CSS position of elements in toolbar search input when scrolling
toolbar (left/right),
fixed inconsistent usage of apostrophes,
fixed sort direction support for NULL value and mixedcase/uppercase
values
  • Loading branch information
mpf82 committed Nov 24, 2016
1 parent 96687f6 commit b83d68f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"description": "Complete set of JavaScript UI widget for development of data-driven web applications. Includes layout, grid, toolbar, sidebar, tabs, forms, fields, popup, overlay",
"license": "MIT",
"repository": "https://github.com/vitmalina/w2ui",
"dependencies" : {
"jquery": ">=1.9"
}
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
Expand Down
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## W2UI 1.4 - MIT License
## W2UI 1.5 - MIT License

W2UI is modern, intuitive JavaScript UI library for building rich data-driven web application. The library has
a small footprint and only jQuery (1.8+) as a dependency.. The library has the following widgets:
a small footprint and only jQuery (1.9+) as a dependency. The library has the following widgets:

* w2layout
* w2grid
Expand All @@ -25,6 +25,7 @@ If you're using w2ui I'd love to hear about it, please email to vitmalina@gmail.
## Quick Start

Current stable version is 1.4.
Current development version is 1.5.rc1.

You can:
- Download from here: [http://w2ui.com](http://w2ui.com)
Expand Down
4 changes: 3 additions & 1 deletion src/less/src/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@
margin-top: 5px;
margin-left: -9px;
color: @form-required-color;
}
}
&.w2ui-span0 {
}
&.w2ui-span1 {
> label { width: (@form-step-label * 1); }
> div { margin-left: ((@form-step-label * 1) + @form-step-field); }
Expand Down
3 changes: 2 additions & 1 deletion src/less/src/grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
// ===== Grid Search =====

.w2ui-toolbar-search {
position: relative;
width: 160px;
margin-right: 3px;

Expand Down Expand Up @@ -827,4 +828,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/w2form.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
// submit save
if (postData == null) postData = {};
if (!obj.url || (typeof obj.url == 'object' && !obj.url.save)) {
console.log("ERROR: Form cannot be saved because no url is defined.");
console.log('ERROR: Form cannot be saved because no url is defined.');
return;
}
obj.lock(w2utils.lang(obj.msgSaving) + ' <span id="'+ obj.name +'_progress"></span>');
Expand Down
11 changes: 5 additions & 6 deletions src/w2grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@
return 1;
if ((aa != null && aa !== "") && (bb == null || bb === ""))
return -1;
var dir = (direction == 'asc') ? 1 : -1;
var dir = (direction.toLowerCase() === 'asc') ? 1 : -1;
// for different kind of objects, sort by object type
if (typeof aa != typeof bb)
return (typeof aa > typeof bb) ? dir : -dir;
Expand Down Expand Up @@ -3949,7 +3949,10 @@
if (this.sortData[sortIndex] == null) {
direction = 'asc';
} else {
switch (String(this.sortData[sortIndex].direction)) {
if(this.sortData[sortIndex].direction == null) {
this.sortData[sortIndex].direction = '';
}
switch (this.sortData[sortIndex].direction.toLowerCase()) {
case 'asc' : direction = 'desc'; break;
case 'desc' : direction = 'asc'; break;
default : direction = 'asc'; break;
Expand Down Expand Up @@ -6172,8 +6175,6 @@
var sortStyle = '';
for (var si = 0; si < obj.sortData.length; si++) {
if (obj.sortData[si].field == col.field) {
if (new RegExp('asc', 'i').test(obj.sortData[si].direction)) sortStyle = 'w2ui-sort-up';
if (new RegExp('desc', 'i').test(obj.sortData[si].direction)) sortStyle = 'w2ui-sort-down';
}
}
var resizer = "";
Expand Down Expand Up @@ -6274,8 +6275,6 @@
var sortStyle = '';
for (var si = 0; si < this.sortData.length; si++) {
if (this.sortData[si].field == col.field) {
if (new RegExp('asc', 'i').test(this.sortData[si].direction)) sortStyle = 'w2ui-sort-up';
if (new RegExp('desc', 'i').test(this.sortData[si].direction)) sortStyle = 'w2ui-sort-down';
}
}
// col selected
Expand Down

0 comments on commit b83d68f

Please sign in to comment.