Skip to content

Commit

Permalink
Merge pull request #140 from aliahmedgroupdocs/master
Browse files Browse the repository at this point in the history
[MVC-10028] #139
  • Loading branch information
Ali Ahmed Sahi committed Jun 1, 2017
2 parents ec45506 + 0a39f7c commit 2647aba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2317,6 +2317,7 @@ $.extend(jSaaspose.PortalService.prototype, {
this.locale,
this.passwordForOpening
);

}
if (typeof viewModelPathOnlineDoc !== 'undefined')
viewModelPathOnlineDoc.pathOnlineDoc('');
Expand Down Expand Up @@ -9595,10 +9596,14 @@ var OverrideMode = {
this._init(options);
},
_init: function (options) {
this.searchValue = ko.observable("");
if (options.searchText != null)
this.searchValue = ko.observable(options.searchText);
else
this.searchValue = ko.observable("");
this.previousEnabled = ko.observable(true);
this.nextEnabled = ko.observable(true);
this.visible = ko.observable(this.searchIsVisible);
//this.findNextFromUI();
},
triggerSearchEvent: function (isCaseSensitive, searchForSeparateWords, treatPhrasesInDoubleQuotesAsExact, useAccentInsensitiveSearch) {
var searchValue = this.searchValue();
Expand Down Expand Up @@ -9968,7 +9973,7 @@ var OverrideMode = {
this.findClosestArea(false, isCaseSensitive, searchForSeparateWords, treatPhrasesInDoubleQuotesAsExactPhrases, useAccentInsensitiveSearch);
},
findNext: function (isCaseSensitive, searchForSeparateWords, treatPhrasesInDoubleQuotesAsExactPhrases, useAccentInsensitiveSearch) {
if (this.searchValue() != "")
if (this.searchValue() != "" )
this.findClosestArea(true, isCaseSensitive, searchForSeparateWords, treatPhrasesInDoubleQuotesAsExactPhrases, useAccentInsensitiveSearch);
},
clearValue: function () {
Expand All @@ -9992,6 +9997,7 @@ var OverrideMode = {
var keyCode = (event.which ? event.which : event.keyCode);
return viewModel.keyHandler(keyCode);
},

keyHandler: function (keyCode) {
if (keyCode === 13) { // Enter
this.findNextFromUI();
Expand All @@ -10018,6 +10024,7 @@ var OverrideMode = {
this.resetButtons();
if (this.searched)
this.element.trigger("onPerformSearch", "");
this.findNextFromUI();
},
loadPagesOnOneLevel: function (notLoadedPageNum, searchForward, isCaseSensitive, searchForSeparateWords, treatPhrasesInDoubleQuotesAsExact) {
var self = this;
Expand Down Expand Up @@ -10120,6 +10127,7 @@ var OverrideMode = {
return jqueryAreaElement1.offset().left - jqueryAreaElement2.offset().left;
});
}

});
})(jQuery);
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@
searchIsVisible: settings.showSearch,
useRtl: settings.useRtl,
useAccentInsensitiveSearch: settings.useAccentInsensitiveSearch,
useVirtualScrolling: settings.useVirtualScrolling
useVirtualScrolling: settings.useVirtualScrolling,
searchText : settings.searchText
};

var thumbnailQuality;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
printWithWatermark: true,
enableStandardErrorHandling: false,
preloadPagesCount: 1,
dragToScroll: false,
//dragToScroll: false,
searchText: "demo",
showSearch: true,
viewerStyle: viewerSyle.ScrollView, //Layout type
localizedStrings: localizedStrings,
});
Expand Down

0 comments on commit 2647aba

Please sign in to comment.