Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Parameter width: 'auto' #136

Open
edyrkaj opened this issue Sep 20, 2013 · 1 comment
Open

Parameter width: 'auto' #136

edyrkaj opened this issue Sep 20, 2013 · 1 comment

Comments

@edyrkaj
Copy link

edyrkaj commented Sep 20, 2013

Hello i used cluetip in my project and i saw that was a problem to use width attr with value 'auto'.
So i changed:
FROM:
/*
width: 275, // The width of the clueTip

  // horizontal measurement variables
  var tipInnerWidth = parseInt(opts.width, 10) || 275,
      tipWidth = tipInnerWidth + cluetipPadding + opts.dropShadowSteps,
      linkWidth = this.offsetWidth,
      linkLeft, posX, tipX, mouseX, winWidth;

/
TO:
/

width: 'auto', // The width of the clueTip

  // horizontal measurement variables
  if (isNaN(parseInt(opts.width, 10))) {
      var tipInnerWidth = 'auto',
      tipWidth = cluetipPadding + opts.dropShadowSteps,
      linkWidth = this.offsetWidth,
      linkLeft, posX, tipX, mouseX, winWidth;
  }
  else {
      var tipInnerWidth = 270,
      tipWidth = tipInnerWidth + cluetipPadding + opts.dropShadowSteps,
      linkWidth = this.offsetWidth,
      linkLeft, posX, tipX, mouseX, winWidth;
  }

*/

@singlagaurav919
Copy link

But in case of 'auto', this won't give the correct tipwidth, which is being used further in the code to calculate positioning, and show incorrect position in UI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants