fix initial value issue #5
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The element has a text like:
"My very long lorem ipsum text that goes on multiple lines"
On resolutions of 767 and up I want it to display on max 3 rows and on lower resolutions I want it to display a max of 6 rows.
My setup is like this:
This resulted in the following:
Init:
<a href="https://google.com" class="product-title" threedots="My very long lorem ipsum text that goes on multiple lines"><span class="ellipsis_text" title="My very long lorem ipsum text that goes on multiple lines">My very long lorem ipsum text that</span><span style="white-space: nowrap; display: inline;" class="threedots_ellipsis"> ...</span></a>- At this point it is okresize - that means reinit because of the update function
<a href="https://google.com" class="product-title" threedots="My very long lorem ipsum text that"><span class="ellipsis_text" title="My very long lorem ipsum text that">My very long lorem ipsum text that</a>It was basically rewriting
init_text_spanwith the actual value in the$(curr_text_span).text()which was not correct after 1 resize.So I added another check that only rewrites the init_text_span if the 'threedots' attribute is not initialized and it fixed my issues.