[mobile] for bug 53182
This commit is contained in:
parent
d8875ec3b9
commit
0945dc55ed
|
@ -92,8 +92,26 @@ class SearchView extends Component {
|
||||||
|
|
||||||
const $$ = Dom7;
|
const $$ = Dom7;
|
||||||
|
|
||||||
$$(document).on('page:init', (e, page) => {
|
this.onSettingsClick = this.onSettingsClick.bind(this);
|
||||||
if ( page.name == 'home' ) {
|
this.onSearchClick = this.onSearchClick.bind(this);
|
||||||
|
this.onReplaceClick = this.onReplaceClick.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount(){
|
||||||
|
this.$replace = $$('#idx-replace-val');
|
||||||
|
const $editor = $$('#editor_sdk');
|
||||||
|
|
||||||
|
this.onEditorTouchStart = this.onEditorTouchStart.bind(this);
|
||||||
|
this.onEditorTouchEnd = this.onEditorTouchEnd.bind(this);
|
||||||
|
|
||||||
|
$editor.on('pointerdown', this.onEditorTouchStart);
|
||||||
|
$editor.on('pointerup', this.onEditorTouchEnd);
|
||||||
|
|
||||||
|
if( !this.searchbar ) {
|
||||||
|
this.searchbar = f7.searchbar.get('.searchbar');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !this.searchbar ) {
|
||||||
this.searchbar = f7.searchbar.create({
|
this.searchbar = f7.searchbar.create({
|
||||||
el: '.searchbar',
|
el: '.searchbar',
|
||||||
customSearch: true,
|
customSearch: true,
|
||||||
|
@ -106,38 +124,12 @@ class SearchView extends Component {
|
||||||
disable: this.onSearchbarShow.bind(this, false)
|
disable: this.onSearchbarShow.bind(this, false)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
// function iOSVersion() {
|
|
||||||
// var ua = navigator.userAgent;
|
|
||||||
// var m;
|
|
||||||
// return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
const $editor = $$('#editor_sdk');
|
|
||||||
// const $replaceLink = $$('#replace-link');
|
|
||||||
|
|
||||||
if (false /* iOSVersion < 13 */) {
|
|
||||||
// $editor.on('mousedown touchstart', this.onEditorTouchStart.bind(this));
|
|
||||||
// $editor.on('mouseup touchend', this.onEditorTouchEnd.bind(this));
|
|
||||||
} else {
|
|
||||||
// $editor.on('pointerdown', this.onEditorTouchStart.bind(this));
|
|
||||||
// $editor.on('pointerup', this.onEditorTouchEnd.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$editor.on('pointerdown', this.onEditorTouchStart.bind(this));
|
componentWillUnmount() {
|
||||||
$editor.on('pointerup', this.onEditorTouchEnd.bind(this));
|
$$('#editor_sdk').off('pointerdown', this.onEditorTouchStart)
|
||||||
// $replaceLink.on('click', this.onReplaceHold.bind(this));
|
.off('pointerup', this.onEditorTouchEnd);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.onSettingsClick = this.onSettingsClick.bind(this);
|
|
||||||
this.onSearchClick = this.onSearchClick.bind(this);
|
|
||||||
this.onReplaceClick = this.onReplaceClick.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount(){
|
|
||||||
const $$ = Dom7;
|
|
||||||
this.$replace = $$('#idx-replace-val');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSettingsClick(e) {
|
onSettingsClick(e) {
|
||||||
|
@ -202,6 +194,7 @@ class SearchView extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditorTouchStart(e) {
|
onEditorTouchStart(e) {
|
||||||
|
console.log('taouch start');
|
||||||
this.startPoint = this.pointerPosition(e);
|
this.startPoint = this.pointerPosition(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue