Skip to content

Commit

Permalink
fixed select something on second page and placeholder for date-picker (
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes authored and chirimoya committed Sep 7, 2016
1 parent 29bf125 commit d0ca58a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
26 changes: 18 additions & 8 deletions dist/husky.js
Original file line number Diff line number Diff line change
Expand Up @@ -32106,6 +32106,10 @@ define('husky_components/datagrid/decorators/table-view',[],function() {
* @param select {Boolean} true to select false to deselect
*/
toggleSelectRecord: function(id, select) {
if (!this.table.rows[id]) {
return;
}

if (select === true) {
this.datagrid.setItemSelected.call(this.datagrid, id);
// ensure that checkboxes are checked
Expand Down Expand Up @@ -45657,7 +45661,7 @@ define('__component__$dropzone@husky',[], function() {
* @params {String} [options.inputId] DOM-id to give the actual input-tag
* @params {String} [options.inputName] DOM-name to give the actual input-tag. Can be usefull in forms
* @params {String} [options.value] value to set at the beginning
* @params {String} [options.placeholder] html5-placholder to use
* @params {String} [options.placeholder] html5-placeholder to use
* @params {Boolean} [options.disabled] defines if input can be edited
* @params {String} [options.skin] name of the skin to use. Currently 'phone', 'password', 'url', 'email', 'date', 'time', 'color'. Each skin brings it's own default values. For example the password skin has automatically inputType: 'password'
* @params {Object} [options.datepickerOptions] config-object to pass to the datepicker component - you can find possible values here http://bootstrap-datepicker.readthedocs.org/en/release/options.html
Expand Down Expand Up @@ -45910,7 +45914,8 @@ define('__component__$input@husky',[], function() {
if (!!this.options.frontIcon) {
this.sandbox.dom.html(this.input.$front, '<a class="fa-' + this.options.frontIcon + '"></a>');
} else if (!!this.options.frontText) {
this.sandbox.dom.html(this.input.$front, '<a class="' + constants.textClass + '">' + this.options.frontText + '</a>');
this.sandbox.dom.html(this.input.$front,
'<a class="' + constants.textClass + '">' + this.options.frontText + '</a>');
} else {
this.sandbox.dom.html(this.input.$front, this.options.frontHtml);
}
Expand Down Expand Up @@ -45945,7 +45950,8 @@ define('__component__$input@husky',[], function() {
if (!!this.options.backIcon) {
this.sandbox.dom.html(this.input.$back, '<span class="fa-' + this.options.backIcon + '"></span>');
} else if (!!this.options.backText) {
this.sandbox.dom.html(this.input.$back, '<span class="' + constants.textClass + '">' + this.options.backText + '</span>');
this.sandbox.dom.html(this.input.$back,
'<span class="' + constants.textClass + '">' + this.options.backText + '</span>');
} else {
this.sandbox.dom.html(this.input.$back, this.options.backHtml);
}
Expand All @@ -45969,7 +45975,9 @@ define('__component__$input@husky',[], function() {
*/
renderDatePicker: function() {
this.sandbox.dom.addClass(this.$el, constants.datepickerClass);
this.sandbox.dom.attr(this.input.$input, 'placeholder', this.sandbox.globalize.getDatePattern());
if (!this.options.placeholder) {
this.sandbox.dom.attr(this.input.$input, 'placeholder', this.sandbox.globalize.getDatePattern());
}

// parse stard and end date
if (!!this.options.datepickerOptions.startDate && typeof(this.options.datepickerOptions.startDate) === 'string') {
Expand All @@ -45979,9 +45987,10 @@ define('__component__$input@husky',[], function() {
this.options.datepickerOptions.endDate = new Date(this.options.datepickerOptions.endDate);
}

this.sandbox.datepicker.init(this.input.$input, this.options.datepickerOptions).on('changeDate', function(event) {
this.setDatepickerValueAttr(event.date);
}.bind(this));
this.sandbox.datepicker.init(this.input.$input, this.options.datepickerOptions).on('changeDate',
function(event) {
this.setDatepickerValueAttr(event.date);
}.bind(this));
this.updateValue();

this.bindDatepickerDomEvents();
Expand Down Expand Up @@ -46084,7 +46093,8 @@ define('__component__$input@husky',[], function() {
this.sandbox.dom.attr(this.sandbox.dom.find('a', this.input.$front), 'target', '_blank');
}
} else {
this.sandbox.dom.removeClass(this.sandbox.dom.find('a', this.input.$front), constants.linkClickableClass);
this.sandbox.dom.removeClass(this.sandbox.dom.find('a', this.input.$front),
constants.linkClickableClass);
this.sandbox.dom.removeAttr(this.sandbox.dom.find('a', this.input.$front), 'href');
}
},
Expand Down
2 changes: 1 addition & 1 deletion dist/husky.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions husky_components/datagrid/decorators/table-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,10 @@ define(function() {
* @param select {Boolean} true to select false to deselect
*/
toggleSelectRecord: function(id, select) {
if (!this.table.rows[id]) {
return;
}

if (select === true) {
this.datagrid.setItemSelected.call(this.datagrid, id);
// ensure that checkboxes are checked
Expand Down
22 changes: 14 additions & 8 deletions husky_components/input/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @params {String} [options.inputId] DOM-id to give the actual input-tag
* @params {String} [options.inputName] DOM-name to give the actual input-tag. Can be usefull in forms
* @params {String} [options.value] value to set at the beginning
* @params {String} [options.placeholder] html5-placholder to use
* @params {String} [options.placeholder] html5-placeholder to use
* @params {Boolean} [options.disabled] defines if input can be edited
* @params {String} [options.skin] name of the skin to use. Currently 'phone', 'password', 'url', 'email', 'date', 'time', 'color'. Each skin brings it's own default values. For example the password skin has automatically inputType: 'password'
* @params {Object} [options.datepickerOptions] config-object to pass to the datepicker component - you can find possible values here http://bootstrap-datepicker.readthedocs.org/en/release/options.html
Expand Down Expand Up @@ -271,7 +271,8 @@ define([], function() {
if (!!this.options.frontIcon) {
this.sandbox.dom.html(this.input.$front, '<a class="fa-' + this.options.frontIcon + '"></a>');
} else if (!!this.options.frontText) {
this.sandbox.dom.html(this.input.$front, '<a class="' + constants.textClass + '">' + this.options.frontText + '</a>');
this.sandbox.dom.html(this.input.$front,
'<a class="' + constants.textClass + '">' + this.options.frontText + '</a>');
} else {
this.sandbox.dom.html(this.input.$front, this.options.frontHtml);
}
Expand Down Expand Up @@ -306,7 +307,8 @@ define([], function() {
if (!!this.options.backIcon) {
this.sandbox.dom.html(this.input.$back, '<span class="fa-' + this.options.backIcon + '"></span>');
} else if (!!this.options.backText) {
this.sandbox.dom.html(this.input.$back, '<span class="' + constants.textClass + '">' + this.options.backText + '</span>');
this.sandbox.dom.html(this.input.$back,
'<span class="' + constants.textClass + '">' + this.options.backText + '</span>');
} else {
this.sandbox.dom.html(this.input.$back, this.options.backHtml);
}
Expand All @@ -330,7 +332,9 @@ define([], function() {
*/
renderDatePicker: function() {
this.sandbox.dom.addClass(this.$el, constants.datepickerClass);
this.sandbox.dom.attr(this.input.$input, 'placeholder', this.sandbox.globalize.getDatePattern());
if (!this.options.placeholder) {
this.sandbox.dom.attr(this.input.$input, 'placeholder', this.sandbox.globalize.getDatePattern());
}

// parse stard and end date
if (!!this.options.datepickerOptions.startDate && typeof(this.options.datepickerOptions.startDate) === 'string') {
Expand All @@ -340,9 +344,10 @@ define([], function() {
this.options.datepickerOptions.endDate = new Date(this.options.datepickerOptions.endDate);
}

this.sandbox.datepicker.init(this.input.$input, this.options.datepickerOptions).on('changeDate', function(event) {
this.setDatepickerValueAttr(event.date);
}.bind(this));
this.sandbox.datepicker.init(this.input.$input, this.options.datepickerOptions).on('changeDate',
function(event) {
this.setDatepickerValueAttr(event.date);
}.bind(this));
this.updateValue();

this.bindDatepickerDomEvents();
Expand Down Expand Up @@ -445,7 +450,8 @@ define([], function() {
this.sandbox.dom.attr(this.sandbox.dom.find('a', this.input.$front), 'target', '_blank');
}
} else {
this.sandbox.dom.removeClass(this.sandbox.dom.find('a', this.input.$front), constants.linkClickableClass);
this.sandbox.dom.removeClass(this.sandbox.dom.find('a', this.input.$front),
constants.linkClickableClass);
this.sandbox.dom.removeAttr(this.sandbox.dom.find('a', this.input.$front), 'href');
}
},
Expand Down

0 comments on commit d0ca58a

Please sign in to comment.