Commit 5e4279f6 authored by Sven Franck's avatar Sven Franck

app: moved enhanceWithin() to place I don't like

parent 8b6eec7e
...@@ -5409,7 +5409,6 @@ ...@@ -5409,7 +5409,6 @@
//TODO: merge with pagebindings, so all jQuery is at one place! //TODO: merge with pagebindings, so all jQuery is at one place!
app.setGlobalBindings = function () { app.setGlobalBindings = function () {
$(document) $(document)
.enhanceWithin()
// generate dynamic pages // generate dynamic pages
.on("pagebeforechange", function (e, data) { .on("pagebeforechange", function (e, data) {
...@@ -5479,6 +5478,8 @@ ...@@ -5479,6 +5478,8 @@
factory.util.generateDynamicContents(app.parseAction(e)); factory.util.generateDynamicContents(app.parseAction(e));
}); });
$(document).enhanceWithin();
// remove focus from active elements on key-tab switches // remove focus from active elements on key-tab switches
window.onblur = function () { window.onblur = function () {
document.activeElement.blur(); document.activeElement.blur();
...@@ -6832,10 +6833,6 @@ ...@@ -6832,10 +6833,6 @@
wrapper.fragment.appendChild(wrapper.placeholder); wrapper.fragment.appendChild(wrapper.placeholder);
} }
// // we should have some wrapper to call enhanceWithin on
// // TODO: only call on whatever we append!
// $(document).enhanceWithin();
// return fragment // return fragment
return RSVP.resolve(wrapper.fragment || undefined); return RSVP.resolve(wrapper.fragment || undefined);
}) })
...@@ -7397,6 +7394,10 @@ ...@@ -7397,6 +7394,10 @@
.then(app.init.config) .then(app.init.config)
.then(app.setGlobalBindings) .then(app.setGlobalBindings)
.then(app.parsePage) .then(app.parsePage)
.then(function () {
// need one call here to initialize whats on the first page
$(document).enhanceWithin();
})
.fail(app.util.error); .fail(app.util.error);
}); });
......
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