mirror of
https://github.com/wekan/wekan.git
synced 2026-03-06 13:50:16 +01:00
Merge pull request #6088 from harryadel/autofocus-migration
Remove mquandalle:autofocus
This commit is contained in:
commit
ff9f29d12d
3 changed files with 13 additions and 2 deletions
|
|
@ -42,7 +42,6 @@ session@1.2.1
|
||||||
tracker@1.3.3
|
tracker@1.3.3
|
||||||
underscore@1.0.13
|
underscore@1.0.13
|
||||||
audit-argument-checks@1.0.7
|
audit-argument-checks@1.0.7
|
||||||
mquandalle:autofocus
|
|
||||||
raix:handlebar-helpers
|
raix:handlebar-helpers
|
||||||
http@2.0.0! # force new http package
|
http@2.0.0! # force new http package
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ mongo-decimal@0.1.3
|
||||||
mongo-dev-server@1.1.0
|
mongo-dev-server@1.1.0
|
||||||
mongo-id@1.0.8
|
mongo-id@1.0.8
|
||||||
mongo-livedata@1.0.12
|
mongo-livedata@1.0.12
|
||||||
mquandalle:autofocus@1.0.0
|
|
||||||
mquandalle:jade@0.4.9
|
mquandalle:jade@0.4.9
|
||||||
mquandalle:jade-compiler@0.4.5
|
mquandalle:jade-compiler@0.4.5
|
||||||
msavin:usercache@1.8.0
|
msavin:usercache@1.8.0
|
||||||
|
|
|
||||||
13
client/lib/autofocus.js
Normal file
13
client/lib/autofocus.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Native replacement for mquandalle:autofocus package
|
||||||
|
// Handles autofocus attribute in dynamically rendered Blaze templates
|
||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
import { Tracker } from 'meteor/tracker';
|
||||||
|
|
||||||
|
Template.onRendered(function() {
|
||||||
|
Tracker.afterFlush(() => {
|
||||||
|
const el = this.find('[autofocus]');
|
||||||
|
if (el && typeof el.focus === 'function') {
|
||||||
|
el.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue