mirror of
https://github.com/documize/community.git
synced 2025-08-09 07:25:23 +02:00
can press return on updated mousetrap lib
This commit is contained in:
parent
038e916db1
commit
f53b911e50
5 changed files with 51 additions and 26 deletions
|
@ -44,7 +44,7 @@
|
|||
|
||||
> .action {
|
||||
float: right;
|
||||
vertical-align: text-top;
|
||||
margin-top: -8px;
|
||||
@extend .cursor-pointer;
|
||||
display: none;
|
||||
color: $color-stroke;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
> .actions {
|
||||
.actions {
|
||||
margin-top: 15px;
|
||||
float: right;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div id="{{contentId}}" class="dropdown-dialog">
|
||||
<form class="form" {{action 'onAction' on="submit"}}>
|
||||
<div class="content">
|
||||
{{yield}}
|
||||
</div>
|
||||
|
@ -18,4 +19,5 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="input-control">
|
||||
<label>New space</label>
|
||||
<div class="tip">A repository for related documentation</div>
|
||||
{{input type='text' id="new-folder-name" value=newFolder}}
|
||||
{{input type='text' id="new-folder-name" class="mousetrap" value=newFolder}}
|
||||
</div>
|
||||
</div>
|
||||
{{/dropdown-dialog}}
|
||||
|
|
31
app/vendor/mousetrap.js
vendored
31
app/vendor/mousetrap.js
vendored
|
@ -1,6 +1,6 @@
|
|||
/*global define:false */
|
||||
/**
|
||||
* Copyright 2015 Craig Campbell
|
||||
* Copyright 2016 Craig Campbell
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -17,11 +17,16 @@
|
|||
* Mousetrap is a simple keyboard shortcut library for Javascript with
|
||||
* no external dependencies
|
||||
*
|
||||
* @version 1.5.2
|
||||
* @version 1.6.0
|
||||
* @url craig.is/killing/mice
|
||||
*/
|
||||
(function(window, document, undefined) {
|
||||
|
||||
// Check if mousetrap is used inside browser, if not, return
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* mapping of special keycodes to their corresponding keys
|
||||
*
|
||||
|
@ -151,7 +156,13 @@
|
|||
* loop through to map numbers on the numeric keypad
|
||||
*/
|
||||
for (i = 0; i <= 9; ++i) {
|
||||
_MAP[i + 96] = i;
|
||||
|
||||
// This needs to use a string cause otherwise since 0 is falsey
|
||||
// mousetrap will never fire for numpad 0 pressed as part of a keydown
|
||||
// event.
|
||||
//
|
||||
// @see https://github.com/ccampbell/mousetrap/pull/258
|
||||
_MAP[i + 96] = i.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -983,6 +994,18 @@
|
|||
return self._handleKey.apply(self, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* allow custom key mappings
|
||||
*/
|
||||
Mousetrap.addKeycodes = function(object) {
|
||||
for (var key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
_MAP[key] = object[key];
|
||||
}
|
||||
}
|
||||
_REVERSE_MAP = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Init the global mousetrap functions
|
||||
*
|
||||
|
@ -1018,4 +1041,4 @@
|
|||
return Mousetrap;
|
||||
});
|
||||
}
|
||||
}) (window, document);
|
||||
}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue