Skip to content
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

Merged
merged 1 commit into from
Sep 13, 2014

Conversation

dfilatov
Copy link
Member

@dfilatov dfilatov commented Sep 9, 2014

No description provided.

return this;
},

/**
* Sets content
* @param {String|jQuery} content
* @returns {popup} this
*/
setContent : function(content) {
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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).

Copy link
Member

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)

Copy link
Contributor

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_*?

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@narqo
Copy link
Member

narqo commented Sep 13, 2014

Tests are passed! Could we squash it and merge?

@dfilatov
Copy link
Member Author

I don't see any reason not to merge it )

narqo pushed a commit that referenced this pull request Sep 13, 2014
popup: split own functionality into target modifiers (close #968)
@narqo narqo merged commit 6818e10 into v2 Sep 13, 2014
@narqo narqo deleted the issues/968@v2 branch September 13, 2014 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants