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

FitText makes the $digest cycle repeat a lot of times, and transition time becomes really long #60

Open
louisdoe opened this issue Jun 7, 2017 · 5 comments

Comments

@louisdoe
Copy link

louisdoe commented Jun 7, 2017

Hey

thanks for ng-FitText, which is great.

I am using it in an Ionic (1) app, and I am experiencing big performance issue when transitionning to a page that contains a fittext directive. The digest cycle is called again several times, and my users can wait 5 seconds to see the next page.

One of the fittext directive is on the items of a ng-repeat.

<ion-slide ng-repeat="s in sliderPages">
					<ul>
						<!-- <li ng-repeat="item in prodata | matchingProBrand:data.computed.proName:data.computed.proBrand | limitTo:s*sliderItemNumber+sliderItemNumber  | limitTo:-sliderItemNumber"> -->
						<li ng-repeat="item in suggestionList | limitTo:s*sliderItemNumber+sliderItemNumber:s*sliderItemNumber ">
							<a class="suggestPro item-content" ng-click="itemID=item.id;changeisFlash();launchComputeService(item.id);">
								<span><img ng-src={{imagesUrls[item.imageName]}} /></span>
								<p class="flex-caption" ng-class="item.fun == '0' ? 'aNormal' :( item.fun == '1' ? 'aSmallWave' : (item.fun == '2' ? 'aStepUp' : ''))" fittext fittext-min="8" fittext-max="12" ng-bind="item.model + ' - ' + (item.name | split:' ':0)" > {{item.model}} - {{item.name | split:' ':0}}</p> 
							</a>
						</li>
					</ul>
				</ion-slide>

Do you have an idea to help me on this ?

@patrickmarabeas
Copy link
Owner

Try setting data-fittext-load-delay to something longer than the expected transition. If that fixes the problem then it'll probably mean adding some checks around whether the parent has a width or something.

If it's possible to whip up a quick demo on JSBin or whatnot showing the bug, that would be mighty helpful.

@louisdoe
Copy link
Author

louisdoe commented Jun 9, 2017 via email

@patrickmarabeas
Copy link
Owner

I only suggest for debugging - if using delay on fittext fixes the issue of transition time, then it's a base from which to patch.

Happy to have code access - I'll get to it as quickly as I can.

@louisdoe
Copy link
Author

louisdoe commented Jun 29, 2017 via email

@patrickmarabeas
Copy link
Owner

In terms of easily testing against the problem, yes that would be helpful.

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

No branches or pull requests

2 participants