Merge branch 'master' into v4

This commit is contained in:
Adam Bradley
2017-05-17 23:04:13 +02:00
2 changed files with 21 additions and 5 deletions

View File

@ -139,7 +139,7 @@ $searchbar-ios-toolbar-input-background: rgba(0, 0, 0, .08) !default;
// ----------------------------------------- // -----------------------------------------
.searchbar-ios .searchbar-ios-cancel { .searchbar-ios .searchbar-ios-cancel {
@include padding(0, 8px, 0, 0); @include padding(0, 0, 0, 8px);
@include margin-horizontal(0, null); @include margin-horizontal(0, null);
display: none; display: none;

View File

@ -238,11 +238,19 @@ export class Searchbar extends BaseInput<string> {
// Set the input padding start // Set the input padding start
var inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)'; var inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)';
inputEle.style.paddingLeft = inputLeft; if (this._plt.isRTL) {
inputEle.style.paddingRight = inputLeft;
} else {
inputEle.style.paddingLeft = inputLeft;
}
// Set the icon margin start // Set the icon margin start
var iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)'; var iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)';
iconEle.style.marginLeft = iconLeft; if (this._plt.isRTL) {
iconEle.style.marginRight = iconLeft;
} else {
iconEle.style.marginLeft = iconLeft;
}
} }
} }
@ -257,11 +265,19 @@ export class Searchbar extends BaseInput<string> {
var cancelStyle = cancelStyleEle.style; var cancelStyle = cancelStyleEle.style;
this._isCancelVisible = showShowCancel; this._isCancelVisible = showShowCancel;
if (showShowCancel) { if (showShowCancel) {
cancelStyle.marginRight = '0'; if (this._plt.isRTL) {
cancelStyle.marginLeft = '0';
} else {
cancelStyle.marginRight = '0';
}
} else { } else {
var offset = cancelStyleEle.offsetWidth; var offset = cancelStyleEle.offsetWidth;
if (offset > 0) { if (offset > 0) {
cancelStyle.marginRight = -offset + 'px'; if (this._plt.isRTL) {
cancelStyle.marginLeft = -offset + 'px';
} else {
cancelStyle.marginRight = -offset + 'px';
}
} }
} }
} }