Skip to content

Commit

Permalink
gallery-2014.02.26-18-54 ItsAsbreuk gallery-itsaviewmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
ekashida committed Feb 26, 2014
1 parent cfa267f commit 2c28b9f
Show file tree
Hide file tree
Showing 36 changed files with 121 additions and 74 deletions.
4 changes: 2 additions & 2 deletions build/gallery-itsaviewmodel/gallery-itsaviewmodel-coverage.js

Large diffs are not rendered by default.

38 changes: 27 additions & 11 deletions build/gallery-itsaviewmodel/gallery-itsaviewmodel-debug.js
Expand Up @@ -1135,6 +1135,7 @@ ITSAViewModel.prototype.render = function (clear, modelchange) {
itsaDateTimePicker = Y.Global.ItsaDateTimePicker,
html = (clear || !model) ? '' : instance._modelRenderer(model),
withfocusmanager;

Y.log('render', 'info', 'ITSA-ViewModel');
/*jshint expr:true */
// we should do a cleanup always, BUT
Expand All @@ -1146,7 +1147,8 @@ ITSAViewModel.prototype.render = function (clear, modelchange) {
// this seems to lead into buttons not listening to click (empty model-internals)
// THUS: commented next line:

// modelchange && !instance.get('partOfMultiView') && model && model.toJSONUI && model.cleanup();
// modelchange && !instance.get('partOfMultiView') && model && model.toJSONUI && model.cleanup();
modelchange && model && model.toJSONUI && model.cleanup(container);



Expand All @@ -1157,15 +1159,22 @@ ITSAViewModel.prototype.render = function (clear, modelchange) {
if (editMode) {
instance._initialEditAttrs = model.getAttrs();
}
container.cleanup(instance._rendered);
// STILL there is a bug that we see when using gallery-itsaviewlogin: container.cleanup messes thing up.
// that is why temporarely commented clenaup:

container.cleanup(instance._rendered);

}
else {
// we should do a cleanup always, BUT
// due to a bug that we haven't found yet, cleanup is no good when using itsaviewmodelpanel, where the footer
// gets rerendered --> some node in the footer gets referenced while it doesn;t exists anymore.
// that's why the conditional is created.
if (!modelchange || !instance.get('partOfMultiView')) {
container.cleanup(false);
// STILL there is a bug that we see when using gallery-itsaviewlogin: container.cleanup messes thing up.
// that is why temporarely commented clenaup:

container.cleanup(false);
}
}
// Append the container element to the DOM if it's not on the page already.
Expand Down Expand Up @@ -1635,7 +1644,7 @@ ITSAViewModel.prototype._bindUI = function() {
}
(prevFormModel !== newFormModel) && newFormModel && instance.get(TEMPLATE) && instance._setTemplateRenderer();
/*jshint expr:false */
instance.render();
instance.render(false, prevFormModel);
}
)
);
Expand Down Expand Up @@ -1695,8 +1704,8 @@ ITSAViewModel.prototype._bindUI = function() {
'*:change',
function(e) {
Y.log('aftersubscriptor '+e.type, 'info', 'ITSA-ViewModel');
if (e.target instanceof Y.Model) {
instance.render(false, true);
if ((e.target instanceof Y.Model) && !e.formelement) {
instance.render();
}
}
)
Expand Down Expand Up @@ -2341,9 +2350,17 @@ ITSAViewModel.prototype[DEF_FN+VALIDATION_ERROR] = function(e) {
// if the node does not have focus yet, setting the focus will lead to tipy-popup.
// when it already has the focus, no tipsy. Thus we need to popup ourselves
// because Y.Tipsy.showTooltip() does not respond to the 'hideon' events, we will call _handleDelegateStart manually:
/*jshint expr:true */
(node.getDOMNode()===Y.config.doc.activeElement) ? Y.ITSAFormElement.tipsyInvalid._handleDelegateStart({currentTarget: node}) : node.focus();
/*jshint expr:false */

if (node.getDOMNode()===Y.config.doc.activeElement) {
Y.ITSAFormElement.tipsyInvalid._handleDelegateStart({currentTarget: node})
}
else {
try {
// ALWAYS focus nodes using try/catch to prevent js-error when node not in the dom
node.focus();
}
catch(err) {}
}
node.scrollIntoView();
}
};
Expand Down Expand Up @@ -2560,7 +2577,7 @@ ITSAViewModel.prototype._setTemplateRenderer = function() {
instance._viewNeedsForm = !instance._contIsForm && !(/<form([^>]*)>/.test(template));
};

}, 'gallery-2014.01.03-22-50', {
}, 'gallery-2014.02.26-18-54', {
"requires": [
"yui-base",
"gallery-itsapluginpromise",
Expand All @@ -2578,7 +2595,6 @@ ITSAViewModel.prototype._setTemplateRenderer = function() {
"event-custom-base",
"oop",
"promise",
"json",
"pluginhost-base",
"gallery-itsamodulesloadedpromise",
"gallerycss-itsa-base"
Expand Down
8 changes: 4 additions & 4 deletions build/gallery-itsaviewmodel/gallery-itsaviewmodel-min.js

Large diffs are not rendered by default.

38 changes: 27 additions & 11 deletions build/gallery-itsaviewmodel/gallery-itsaviewmodel.js
Expand Up @@ -1120,6 +1120,7 @@ ITSAViewModel.prototype.render = function (clear, modelchange) {
itsaDateTimePicker = Y.Global.ItsaDateTimePicker,
html = (clear || !model) ? '' : instance._modelRenderer(model),
withfocusmanager;

/*jshint expr:true */
// we should do a cleanup always, BUT
// due to a bug that we haven't found yet, cleanup is no good when using itsaviewmodelpanel, where the footer
Expand All @@ -1130,7 +1131,8 @@ ITSAViewModel.prototype.render = function (clear, modelchange) {
// this seems to lead into buttons not listening to click (empty model-internals)
// THUS: commented next line:

// modelchange && !instance.get('partOfMultiView') && model && model.toJSONUI && model.cleanup();
// modelchange && !instance.get('partOfMultiView') && model && model.toJSONUI && model.cleanup();
modelchange && model && model.toJSONUI && model.cleanup(container);



Expand All @@ -1141,15 +1143,22 @@ ITSAViewModel.prototype.render = function (clear, modelchange) {
if (editMode) {
instance._initialEditAttrs = model.getAttrs();
}
container.cleanup(instance._rendered);
// STILL there is a bug that we see when using gallery-itsaviewlogin: container.cleanup messes thing up.
// that is why temporarely commented clenaup:

container.cleanup(instance._rendered);

}
else {
// we should do a cleanup always, BUT
// due to a bug that we haven't found yet, cleanup is no good when using itsaviewmodelpanel, where the footer
// gets rerendered --> some node in the footer gets referenced while it doesn;t exists anymore.
// that's why the conditional is created.
if (!modelchange || !instance.get('partOfMultiView')) {
container.cleanup(false);
// STILL there is a bug that we see when using gallery-itsaviewlogin: container.cleanup messes thing up.
// that is why temporarely commented clenaup:

container.cleanup(false);
}
}
// Append the container element to the DOM if it's not on the page already.
Expand Down Expand Up @@ -1606,7 +1615,7 @@ ITSAViewModel.prototype._bindUI = function() {
}
(prevFormModel !== newFormModel) && newFormModel && instance.get(TEMPLATE) && instance._setTemplateRenderer();
/*jshint expr:false */
instance.render();
instance.render(false, prevFormModel);
}
)
);
Expand Down Expand Up @@ -1662,8 +1671,8 @@ ITSAViewModel.prototype._bindUI = function() {
instance.after(
'*:change',
function(e) {
if (e.target instanceof Y.Model) {
instance.render(false, true);
if ((e.target instanceof Y.Model) && !e.formelement) {
instance.render();
}
}
)
Expand Down Expand Up @@ -2286,9 +2295,17 @@ ITSAViewModel.prototype[DEF_FN+VALIDATION_ERROR] = function(e) {
// if the node does not have focus yet, setting the focus will lead to tipy-popup.
// when it already has the focus, no tipsy. Thus we need to popup ourselves
// because Y.Tipsy.showTooltip() does not respond to the 'hideon' events, we will call _handleDelegateStart manually:
/*jshint expr:true */
(node.getDOMNode()===Y.config.doc.activeElement) ? Y.ITSAFormElement.tipsyInvalid._handleDelegateStart({currentTarget: node}) : node.focus();
/*jshint expr:false */

if (node.getDOMNode()===Y.config.doc.activeElement) {
Y.ITSAFormElement.tipsyInvalid._handleDelegateStart({currentTarget: node})
}
else {
try {
// ALWAYS focus nodes using try/catch to prevent js-error when node not in the dom
node.focus();
}
catch(err) {}
}
node.scrollIntoView();
}
};
Expand Down Expand Up @@ -2502,7 +2519,7 @@ ITSAViewModel.prototype._setTemplateRenderer = function() {
instance._viewNeedsForm = !instance._contIsForm && !(/<form([^>]*)>/.test(template));
};

}, 'gallery-2014.01.03-22-50', {
}, 'gallery-2014.02.26-18-54', {
"requires": [
"yui-base",
"gallery-itsapluginpromise",
Expand All @@ -2520,7 +2537,6 @@ ITSAViewModel.prototype._setTemplateRenderer = function() {
"event-custom-base",
"oop",
"promise",
"json",
"pluginhost-base",
"gallery-itsamodulesloadedpromise",
"gallerycss-itsa-base"
Expand Down
2 changes: 1 addition & 1 deletion build/gallery-itsaviewmodel/lang/gallery-itsaviewmodel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c28b9f

Please sign in to comment.