Commit 56fcef50 authored by Laurent Sittler's avatar Laurent Sittler ©
Browse files

feat(search): prevent enter keyup

parents d9aa7354 2ef3af4d
Pipeline #1019 passed with stages
in 2 minutes and 33 seconds
......@@ -8,7 +8,7 @@ Ghost theme using the Fluent UI framework and based on the Microsoft SharePoint
To enjoy the features of this theme, some of them should be configured manually in accordance with your wishes.
You can see more information about the configuration into the [Wiki](../../wikis) pages of this project.
You can see more information about the configuration in the [Wiki](../../wikis) pages of this project.
## Path to awesome
......@@ -56,11 +56,11 @@ Use the provided Docker compose to install and test the theme:
### Local deployment test
Among the different gulp tasks, one of thme consist to deploy automatically the theme into the target Ghost environment.
Among the different gulp tasks, one of them consists to deploy automatically the theme into the target Ghost environment.
It is possible to test it locally:
1. Create a Ghost integration access token (from the admin web interface)
2. Create a `.env` file into the root of the solution
3. Append to the environment file, `GHOST_API_URL=`
4. Append to the environment file, `GHOST_ADMIN_API_KEY`
\ No newline at end of file
4. Append to the environment file, `GHOST_ADMIN_API_KEY`
......@@ -20,9 +20,11 @@ var SearchConnectors = (function () {
_onDismiss = null;
var searhcInput = document.getElementById('SuiteBarSearchInput');
if ('undefined' !== typeof ghosthunter_key && null != ghosthunter_key && searhcInput) {
this.preventEnter(searhcInput);
this.ghostHunterConnector();
this.updateJSONDL();
} else if ('undefined' !== typeof elasticsearch_auth && null != elasticsearch_auth && searhcInput) {
this.preventEnter(searhcInput);
this.elasticsearchConnector(elasticsearch_auth);
this.initSearchFromURL();
this.updateJSONDL();
......@@ -69,6 +71,14 @@ var SearchConnectors = (function () {
configurable: true
});
SearchConnectors.prototype.preventEnter = function (elem) {
elem.addEventListener('keydown', function(e) {
if (e.which == 13 || e.keyCode == 13) {
e.preventDefault();
}
});
};
SearchConnectors.prototype.ghostHunterConnector = function () {
var _this = this;
$('#SuiteBarSearchInput').ghostHunter({
......
{
"name": "fluent-ui",
"description": "A Ghost Theme based on Microsoft Fluent UI Framework and Microsoft SharePoint design",
"version": "0.0.3",
"version": "0.0.4",
"engines": {
"ghost": ">=3.0.0",
"ghost-api": "v3"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment