-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
popup: split own functionality into target modifiers (close #968) #1007
Conversation
return this; | ||
}, | ||
|
||
/** | ||
* Sets content | ||
* @param {String|jQuery} content | ||
* @returns {popup} this | ||
*/ | ||
setContent : function(content) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need this method in common api? Maybe move it to _target
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are _target
and setContent
related to each other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setContent
is valuable because it does 2 things at the same time: updates the DOM and redraws the popup. Since we need to redraw the popup only in _target_*
modifications, this method valuable only in this modifications. in popup.js
it only updates the DOM and loses value, because we can do that just through BEMDOM.update(popup.domElem, content)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's inconsistent to have two ways to update content of popup (which apply differently depend on just modifier)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, would you implement the setContent()
method, if you weren't need to .redraw()
popup in the _target_*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would. It's often case in applications I'm developing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Tests are passed! Could we squash it and merge? |
2d7a350
to
a319b61
Compare
I don't see any reason not to merge it ) |
popup: split own functionality into target modifiers (close #968)
No description provided.