GithubHelp home page GithubHelp logo

720kb / angular-tooltips Goto Github PK

View Code? Open in Web Editor NEW
353.0 15.0 158.0 1.36 MB

Angularjs tooltips module, add tooltips to your elements - https://720kb.github.io/angular-tooltips

JavaScript 11.99% HTML 77.98% CSS 10.02%
angular tooltips angularjs angular-directives directive

angular-tooltips's Introduction

Angular Tooltips

Join the chat at https://gitter.im/720kb/angular-tooltips

Angular Tooltips is an AngularJS directive that generates a tooltip on your element.

The angular tooltips is developed by 720kb.

Requirements

AngularJS v1.3+

Screen

Angular tooltips

Browser support

Chrome Firefox IE Opera Safari
IE9 +

Load

To use the directive, include the Angular Tooltips javascript and css files in your web page:

<!DOCTYPE HTML>
<html>
<head>
  <link href="dist/angular-tooltips.min.css" rel="stylesheet" type="text/css" />
</head>
<body ng-app="app">
  //.....
  <script src="dist/angular-tooltips.min.js"></script>
</body>
</html>

Installation

Bower

$ bower install angular-tooltips --save

npm

$ npm install angular-tooltips --save

then load the js files in your html

Add module dependency

Add the 720kb.tooltips module dependency

angular.module('app', [
  '720kb.tooltips'
 ]);

Call the directive wherever you want in your html page

<a href="#" tooltips tooltip-template="tooltip">Tooltip me</a>

Doc

Option Type Default Description
tooltip-side="" String('left','right','top','bottom','top left','top right','bottom left','bottom right') 'top' Set your tooltip to show on left or right or top or bottom or top left or top right or bottom left or bottom right position
tooltip-template="" String() '' Set your tooltip template (HTML or just Text)
to know: don't use it together with tooltip-template-url attribute, use only one of them
tooltip-template-url="" String() '' Set your external tooltip template PATH
to know: don't use it together with tooltip-template attribute, use only one of them
tooltip-template-url-cache="" String(Boolean) false This attribute stores and retrieves the template from the cache
tooltip-controller="" String() '' Set a controller to your external tooltip template
tooltip-smart="" String(Boolean) false Set the tooltip to automatically search the best position on the screen
tooltip-show-trigger="" String('event1 event2') 'mouseover' Show the tooltip on specific event/events
tooltip-hide-trigger="" String('event1 event2') 'mouseleave' Hide the tooltip on specific event/events
tooltip-close-button="" String(Boolean) false Enable the tooltip close button
tooltip-class="" String() '' Set custom tooltip CSS class/classes
tooltip-size="" String('large', 'small') 'medium' Set your tooltip dimensions
tooltip-speed="" String('fast', 'slow', 'medium') 'medium' Set your tooltip show & hide transition speed
tooltip-hidden="" String(Boolean) false Hide (at all) the tooltip
tooltip-append-to-body="" String(Boolean) false This attribute clones the tooltip and append this directly on body. This enables the tooltip position also, for instance, if you have an scrolling area. This option does heavy javascript calculation.
tooltip-show="" String(Boolean) false Show/Hide the tooltip "manually"

Globals

Sometimes you may need to set all of your tooltips options in one place, you can achieve this using tooltipsConfProvider like this:

.config(['tooltipsConfProvider', function configConf(tooltipsConfProvider) {
  tooltipsConfProvider.configure({
    'smart': true,
    'size': 'large',
    'speed': 'slow',
    'tooltipTemplateUrlCache': true
    //etc...
  });
}])

Example

Theming

You can create your own theme by editing the default SASS file lib/angular-tooltips.scss or just editing the default CSS file dist/angular-tooltips.css.

Contributing

We will be much grateful if you help us making this project to grow up. Feel free to contribute by forking, opening issues, pull requests etc.

License

The MIT License (MIT)

Copyright (c) 2014 Filippo Oretti, Dario Andrei

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

angular-tooltips's People

Contributors

45kb avatar camerondubas avatar cdwort avatar dominique-mueller avatar fedyk avatar geoctrl avatar ghostboyzone avatar gitter-badger avatar hellomrbrown avatar hpeinar avatar kynoyang avatar leonard-thieu avatar lulzaugusto avatar makamuy avatar maximilianschmitt avatar mchambaud avatar noahbornstein avatar omer avatar panzerdp avatar psdcoder avatar rdr4g0n avatar rrafael27 avatar ryppy avatar sagivf avatar tkrupers avatar weijyewang avatar wouldgo avatar zhangoose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-tooltips's Issues

Tooltips appear off page when used in mdSidenav

When using the tooltip on an item in mdSidenav, the tooltip is shown off the page. It seems to be shown at the original position of the mdSidenav (at least I think this is what is happening).

caret disappears if content is more than one liner

When I have content one liner, caret appears.
But when I have content more than one liner, caret disappears and flat rectangle appears.

Any solution to this?

<i class="icon ion-ios-information-outline fa fa-2x right-icon" tooltips tooltip-side="left" tooltip-try="1" tooltip-content="Enter your personal number"></i>

Tooltips are incorrectly positioned after scrolling in a container

Hey!

So I found this bug in your directive where when a user scrolls in a DIV with overflow: scroll, it does not re-calculate the position of the element. tooltip-lazy and tooltip-scroll do not help either.

Here are some screenshots:

Before: (expected)

tooltip ok

After: (unexpected)

tooltip not ok

Allow for the same event to 'toggle' display of tooltips

There doesn't appear to be way to allow the same event to be used to "toggle" the display of a tooltip. For example, consider what would happen when I configure the directive as follows:

<a href="#" tooltips="" tooltip-title="tip" tooltip-show-trigger="click" tooltip-hide-trigger="click" tooltip-side="left">Show tooltip on click and hide tooltip only on click</a>

I was hoping this would allow me to click on the link and see the tooltip show up, then be able to click on the link again to hide it (effectively toggling the display). From my testing, however, it does not appear to work that way because the 'click' event is being bound with two separate callbacks at the same time.
So when I click on the link, both callbacks are fired immediately. This causes the tooltip to open and then close immediately after, sometimes even fast enough to where I can't see it.

It would be nice if we could specify a single event for both open and close actions that will behave as a toggle when invoked.

Tooltips over other icons with tooltips can't be clicked

Hello, I was on v0.1.9 I guess and today I updated my dependencies. Since then, with the latest v0.1.18 my tooltips overlap the other icon's "events" that have some kind of clickable/hover behaviors.
You can see on the following printscreen that this work fine, but notice that this tooltip is over an icon on the row above:
http://i.imgur.com/REcIqTo.png
As result, when I put my mouse over the icon on that row above the icon, it cannot trigger its events (show the tooltip, trigger the :hover css rule, trigger the ng-click):
http://i.imgur.com/vJ90v2S.png

How can I fix this?

Thanks

Sass and LESS

Sass and LESS integration would be nice, with some variables that can be changed from outside.

interacting with tooltip

We are looking to add some html into the tooltip which the user can interact with (5 star rating). However, we are currently having to set it to hide on click since the tooltip disappears when the mouse is moved into the tooltip.

How easy would it be to change it so that the tooltip stays open if the mouse is moved on to the tooltip? It should be hidden only if the mouse is not on the original element OR the tooltip itself.

resize tooltip for small-screens

I just wanted to comment first thanking you for this great plugin.
Not even the Angular UI-Bootstrap has the 'auto'-placement feature that tooltrip-try="1" does (Bootstrap does but its not implemented in UI-Bootstrap).
Most of my site's popups went over the top, or sides of the website with UI-Bootstrap even on desktop browsers.

I was going to ask if its possible to set it up so when on a small-screen something more mobile friendly happens, as this is the only time I still see unusual behavior.
Like when starting off my desktop browser with a small width, the tooltips still goes off screen.

Also using mobile is just a weird experience with all tooltips I have used.
I thought about this and thought the nicest thing would be to auto-add a special icon like a font-awesome '?' or 'i' that users know to click for more info next to the abbreviation/definition they are placing the tooltip on.
and if you click on that on icon hyperlink, it opens a fairly large tooltip-info window so they can read it on mobile. It may have an 'X' at the top (and/or close button button at bottom) so that you can close it (and/or auto-disappears after 10 seconds).
Not sure if this would be within scope for angular-tooltips but just thought I'd mention it would be a nice functionality that you can turn on with maybe a tooltip-definition="true" or maybe tooltip-mobile-friendly="true" to indication if want to turn on the optional feature to auto-add this '?' hyperlink for mobile.

Thanks again,
Ari

P.S. I'm using your plugin like so:

Do you have <em class="glossary" tooltips=""  tooltip-side="top" tooltip-try="1" tooltip-content="Irritable Bower Syndrome is a disease which can affect alot of people... ">IBS</em>?

Delayd tooltip

Thanks for a great directive :)

Tooltip animation seems to start right away.
It would be nice to have a delayed tooltip which starts animation after x milliseconds.
If user moves cursor away, animation is cancelled.

tooltip should not takes up space when it's hidden

@45kb hi, I got a problem caused by visibility: hidden since "hidden" here means "can't be seen but take up space".

In my project, the whole page's height is 100vh. However, I found after using tooltips, the body element could be scrolled. I tried several times and found it's tooltips that are below the body element before they are initialized.

So far, I have to set tooltip's top to avoid it taking space below body element.

So, I think maybe we should use display: none or block to control tooltip's visibility.

Add support for smooth animations

Could be great to specify a new attribute, something like:

< a tooltips tooltip-speed="fast | medium | slow | int" > tooltip me < /a >

binding html to content

Would be nice to be able to add html to content.
I think it was possible, but broke when content was made dynamic

Tooltips lose position in scrollable elements

First off, I love this library. It's really wonderful.

I'm running into an issue where I have tooltips on elements inside of a scrollable area. The scrollable area is using a javascript scrolling solution (perfect scroll bar). Unfortunately, the tooltips lose their position upon scrolling.

Is there a way to re-initialize them on a scroll event? Perhaps a CSS fix?

Thanks for the wonderful library :)

How set dynamic tooltip title?

I want use tooltip with dynamic content set from controller variable but when I try something like this:
tooltip-title="{{controller.message}}"
two-way-binding not work. Tooltip show only first assign message text.

Tooltip does not show on mobile device

Hello, I am developing an app using ionic and am using your tooltips to display tooltips for input labels like so:

 <label class="item item-input item-floating-label "  tooltips tooltip-content='Hello'>
                <span class="input-label">username</span>
                <input autocapitalize="none" autocomplete="off"
                       autocorrect="off" type="text"
                       placeholder="username"
                       ng-model="loginData.username">
            </label>

It works fine on desktop but when I move it to a mobile device (tested in iOS) it does not show up.
Do you know why? Do I need to use a special trigger for mobile devices?

thanks

Tooltip-view watcher

Should be great to have a watcher when tooltip-view is specified, since if the specified view gets updated the tooltip should be recalculated.

Actually if you dynamically change the view content tooltip is not updated

Enabling and disabling tooltip

Thanks for a great directive :)

It would be nice to be able to disable and enable tooltips.
Sometimes tooltips might be a bit annoying if they keep popping up each time when mouse is moved over etc.
This feature would make it real easy to show tooptip only once etc.
"Hey did you notice this nice feature?"

Dynamic html content (ng-bind) within tooltip-html?

Hi,

How to embed dynamic html content for the tooltip? I need to calculate values for the content, for example:

<span ng-bind='event.duration / 3600 | number:2'></span>

PS. It would be nice to be able to have html content loaded optionally from view files. Angular UI library has had problems with that so there are not many options around.

README and gh-page updates

tooltip-try
tooltip-speed
tooltip-lazy
tooltip-show-trigger
tooltip-hide-trigger
tooltip-class

not about tooltip-title & title

Tooltips in ng-repeat

Hey there. First of all, nice work with these simple-to-use tooltips.
Any way we can set a conditional to add or not the tooltip in a ng-repeat, based on a scope variable?

Thanks in advance.

elem.offsetParent returns undefined instead of null in Internet Explorer when tooltip is added to SVG tag

Error
"Unable to get property 'offsetParent' of undefined or null reference"

Change

$scope.getRootOffsetTop = function getRootOffsetTop (elem, val){
if (elem.offsetParent === null) {
  return val + elem.offsetTop;
}


$scope.getRootOffsetLeft = function getRootOffsetLeft (elem, val){
if (elem.offsetParent === null) {
  return val + elem.offsetLeft;
}

To

$scope.getRootOffsetTop = function getRootOffsetTop (elem, val){
  if (!elem.offsetParent) {
    return val + elem.offsetTop;
  }


$scope.getRootOffsetLeft = function getRootOffsetLeft (elem, val){
  if (!elem.offsetParent) {
    return val + elem.offsetLeft;
  }

Work Around

  • Wrap SVG tag with a DIV tag and add tooltip to the DIV tag instead

I will try my best to update with Plunker and make a PR

Fade out transition

Right now the tooltip is nicely fading in when hovering over an element - but when leaving the area the tooltip disappears without any transition.

Wouln't it be nice to also have an fading out transition, maybe shorter that the fading in one ?

CSS styling tooltip caret arrow

Am i doing something wrong?
on the item iteslef i added : tooltips tooltip-title="Coming Soon" tooltip-class="green-tooltip"
I attached the print of htmlTemplate:

<div class="_720kb-tooltip _720kb-tooltip-medium"><div class="_720kb-tooltip-title"> {{title}}</div>{{content}} <span class="_720kb-tooltip-caret"></span></div>

also attached the css:

.green-tooltip
{
  background: none;
  background-color: #29c86a;

  color:white;
  position:absolute;
  z-index:9;
  padding:0.4% 1%;
  opacity:0;
  visibility: hidden;
  -webkit-border-radius:3px;
  -moz-border-radius:3px;
  border-radius:3px;
  left: -200%;
  top: 0;
}


.green-tooltip-title{
  color:rgba(255,255,255,0.95);
  font-weight: 500;
  width: 100%;
  clear:both;
}
.green-tooltip.green-tooltip-small {
  padding:4.5px 10px;
  font-size: 12px;
}
.green-tooltip.green-tooltip-medium {
  padding:7px 15px;
  font-size: 13.5px;
}
.green-tooltip.green-tooltip-large {
  padding:10px 20px;
  font-size: 14px;
}
.green-tooltip.green-tooltip-open {
  visibility: visible;
  visibility: initial;
  opacity: 1;
}
.green-tooltip-caret:before {
  content:'';
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid #29c86a !important;
}
.green-tooltip-caret:after {
  content:'';
  position: absolute;
  width: 0;
  height: 0;
  border: 5px solid transparent;
}
.green-tooltip-left .green-tooltip-caret:before {
  top: 50%;
  left: 100%;
  margin-left:0;
  margin-top: -6px;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-right-width: 0;
}
.green-tooltip-left .green-tooltip-caret:after {
  top: 50%;
  left: 100%;
  margin-left:0;
  margin-top: -5px;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-right-width: 0;
}
.green-tooltip-right .green-tooltip-caret:before {
  top: 50%;
  left:0;
  margin-left:-6px;
  margin-top: -6px;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-width: 0;
}
.green-tooltip-right .green-tooltip-caret:after {
  top: 50%;
  left:0;
  margin-left:-5px;
  margin-top: -5px;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-width: 0;
}
.green-tooltip-top .green-tooltip-caret:before {
  top: 100%;
  left: 50%;
  margin-left: -6px;
  margin-bottom:-6px;
  border-right-color: transparent;
  border-left-color: transparent;
  border-bottom-width: 0;
}
.green-tooltip-top .green-tooltip-caret:after {
  top: 100%;
  left: 50%;
  margin-left: -5px;
  margin-bottom:-5px;
  border-right-color: transparent;
  border-left-color: transparent;
  border-bottom-width: 0;
}
.green-tooltip-bottom .green-tooltip-caret:before {
  bottom: 100%;
  left: 50%;
  margin-left: -6px;
  border-right-color: transparent;
  border-left-color: transparent;
  border-top-width: 0;
}
.green-tooltip-bottom .green-tooltip-caret:after {
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-right-color: transparent;
  border-left-color: transparent;
  border-top-width: 0;
}
.green-tooltip-close-button {
  float: right;
}

image

Tooltip doesn't hide after page change

I've a tooltip on mouseover, but if the page is changed while the tooltip is shown, it won't hide.
In my case it's a tooltip for a button, so the tooltip will always be shown if users want to click it.

<a ng-href="/systems" tooltips tooltip-title="Title" tooltip-content="Description" tooltip-side="left">Link text</a>

Multuple tool tips with ionic cause Error: [$compile:multidir]

Anagular 1.4.3
Ionic 1.1
using multiple tool tips in a view is causing:

Error: [$compile:multidir] http://errors.angularjs.org/1.4.3/$compile/multidir?p0=ngController&p1=&p2=tooltips&p3=&p4=new%2Fisolatedcope&p5=%3Cbutton%20tooltips%3D%22%22%20ng-controller%3D%22FavPlacesCtrl%22%20class%3D%22button%20button-dark%20button-clear%20button-icon%ion-android-compass%22%20ng-click%3D%showMFilterFavPlace()%22%3E
at Error (native)
at http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:37:416
at O (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:100:355)
at E (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:94:8)
at S (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:86:20)
at S (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:86:150)
at S (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:86:150)
at S (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:86:150)
at Z (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:83:467)
at c.controller.I.appendViewElement (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:444:3638)(anonymous function) @ ionic.bundle.min.js:139b.$get @ ionic.bundle.min.js:111(anonymous function) @ app.js:194Y @ ionic.bundle.min.js:104S @ ionic.bundle.min.js:93g @ ionic.bundle.min.js:85S @ ionic.bundle.min.js:92g @ ionic.bundle.min.js:85S @ ionic.bundle.min.js:92g @ ionic.bundle.min.js:85(anonymous function) @ ionic.bundle.min.js:84c.controller.I.appendViewElement @ ionic.bundle.min.js:444c.factory..create.H.render @ ionic.bundle.min.js:443c.factory..create.H.init @ ionic.bundle.min.js:443c.controller.I.render @ ionic.bundle.min.js:444c.controller.I.register @ ionic.bundle.min.js:444a @ ionic.bundle.min.js:446(anonymous function) @ ionic.bundle.min.js:446a.$get.n.$broadcast @ ionic.bundle.min.js:168x.transitionTo.x.transition.I.then.x.transition.x.transition @ ionic.bundle.min.js:420(anonymous function) @ ionic.bundle.min.js:151a.$get.n.$eval @ ionic.bundle.min.js:165a.$get.n.$digest @ ionic.bundle.min.js:163a.$get.n.$apply @ ionic.bundle.min.js:166l @ ionic.bundle.min.js:118F @ ionic.bundle.min.js:122K.onload @ ionic.bundle.min.js:123
app.js:196 EXCP: [$compile:multidir] http://errors.angularjs.org/1.4.3/$compile/multidir?p0=ngController&p1=&p2=…-icon%20ion-android-compass%22%20ng-click%3D%22showMFilterFavPlace()%22%3E
ionic.bundle.min.js:139 Error: [$parse:syntax] http://errors.angularjs.org/1.4.3/$parse/syntax?p0=item&p1=is%20an%20unexpected%20token&p2=27&p3=config.actions.logout_tabNaNtem-button&p4=item-button
at Error (native)
at http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:37:416
at Object.q.throwError (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:240:32)
at Object.q.ast (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:232:296)
at Object.rd.compile (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:241:406)
at hc.parse (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:267:376)
at b.$get (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:149:384)
at n.a.$get.n.$watch (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:159:410)
at a.link (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:283:304)
at Y (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:104:89)(anonymous function) @ ionic.bundle.min.js:139b.$get @ ionic.bundle.min.js:111(anonymous function) @ app.js:194Y @ ionic.bundle.min.js:104S @ ionic.bundle.min.js:93g @ ionic.bundle.min.js:85g @ ionic.bundle.min.js:85S @ ionic.bundle.min.js:92g @ ionic.bundle.min.js:85g @ ionic.bundle.min.js:85S @ ionic.bundle.min.js:92g @ ionic.bundle.min.js:85S @ ionic.bundle.min.js:92g @ ionic.bundle.min.js:85S @ ionic.bundle.min.js:92g @ ionic.bundle.min.js:85(anonymous function) @ ionic.bundle.min.js:84c.controller.I.appendViewElement @ ionic.bundle.min.js:444c.factory..create.H.render @ ionic.bundle.min.js:443c.factory..create.H.init @ ionic.bundle.min.js:443c.controller.I.render @ ionic.bundle.min.js:444c.controller.I.register @ ionic.bundle.min.js:444a @ ionic.bundle.min.js:446(anonymous function) @ ionic.bundle.min.js:446a.$get.n.$broadcast @ ionic.bundle.min.js:168x.transitionTo.x.transition.I.then.x.transition.x.transition @ ionic.bundle.min.js:420(anonymous function) @ ionic.bundle.min.js:151a.$get.n.$eval @ ionic.bundle.min.js:165a.$get.n.$digest @ ionic.bundle.min.js:163a.$get.n.$apply @ ionic.bundle.min.js:166l @ ionic.bundle.min.js:118F @ ionic.bundle.min.js:122K.onload @ ionic.bundle.min.js:123
app.js:196 EXCP: [$parse:syntax] http://errors.angularjs.org/1.4.3/$parse/syntax?p0=item&p1=is%20an%20unexpe…ed%20token&p2=27&p3=config.actions.logout_tab%20item-button&p4=item-button
ionic.bundle.min.js:139 Error: [$parse:syntax] http://errors.angularjs.org/1.4.3/$parse/syntax?p0=item&p1=is%20an%20unexpected%20token&p2=27&p3=config.actions.logout_tabNaNtem-button&p4=item-button
at Error (native)
at http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:37:416
at Object.q.throwError (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:240:32)
at Object.q.ast (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:232:296)
at Object.rd.compile (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:241:406)
at hc.parse (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:267:376)
at b.$get (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:149:384)
at n.a.$get.n.$watch (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:159:410)
at a.link (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:283:304)
at Y (http://localhost:8100/lib/ionic/js/ionic.bundle.min.js:104:89)

tooltip-side not always being honoured.

Great library! I ran into a little issue which I can't seem to solve. I have a directive which dynamically adds a tooltip to a set of images like this:

for(var slug in categoriesTable){
    var categoryUrl = baseURL + categoriesTable[slug];

    var URLToAppend = '<img src="'; 
          URLToAppend += _.contains(scope.categories, slug)? categoryUrl + ".svg" : categoryUrl + "_unavailable.svg";
          URLToAppend += '" tooltips tooltip-side="bottom" tooltip-title="';
          URLToAppend += slug;
          URLToAppend += '">';

    var elementToAppend = angular.element(URLToAppend);
    element.append(elementToAppend);

    $compile(elementToAppend)(scope);
}

The first time I call this directive, it shows up like it should (on the bottom), however the second time it's called it shows up on the right hand side.
I inspect the first and the second elements in Chrome's inspector but both the HTML outputs are the same.

Any insight is greatly appreciated.

Does not work with FastClick

Hello :)

We are using the angular-tooltip in our web-application. The web-application works on desktop and as a mobile web-app on tablets (iPad and Surface). The tooltip worked for a long time without problems. Yesterday we included the FastClick to our angular-module. We downloaded the fastclick.js from this github: https://github.com/ftlabs/fastclick/tree/master/lib After this, we implemented follow code into our angular-module:

angular.module("Master", ["controllers", "720kb.tooltips"]).run(function() {
FastClick.attach(document.body);
});

The FastClick worked fine on the tablet, but than we recognized, that our tooltips don't work on the tablet with the implemented FastClick. It only worked on the desktop. We removed the FastClick to test this, and than the tooltip worked again. So the problem may be, that the FastClick do some things faster than the tooltip so it can't popup. The FastClick is very important for mobile-apps so we need it. But, also we need the tooltip. Now we test a workaround: We are trying to set a timeout of 0.2 or 0.3 seconds on the divs, which have a tooltip. So the FastClick would work on all other click-events. We hope this workes. We would anyway be grateful if you could resolve the issue, because this is only a workaround.

Thanks and have a nice day!

  • TheWebinator :)

Wrong syntax in the CSS file

I fixed a syntax error in the CSS file where the visibility attribute was wrongly spelt. Also, fixed spacing issues in the whole angular-tooltips.css file. I can create a pull request to if you can let me commit to the codebase.

String interpolation from scope variables?

Is it possible to have string interpolation in the template? I'm trying to generate tooltips for a list of items in a repeater.

Example controller:

// items actually gets populated from a service, and that from $http earlier in the process
$scope.items = [
  {name: 'foo', description: 'some details about foo',
 ...
]

And the view iterates over these items and displays them in a condensed form (just first few characters of the name), because space is limited.

Then trying to have the tooltip show the full name, so the template for tooltip:

{{item.name}}
<br>
{{item.description}}

But it doesn't interpolate. I tried passing in a controller to the tooltip, but couldn't figure out how to share the particular item instance that user is hovered over to the tooltip controller.

Tooltip only shows up right

I cannot seem to make the tooltip go on the bottom. I have added "720kb.tooltips" as a dependency, added angular-tooltip.min.js in my javascripts, and added the angular-tooltip.min.css to my css links as well.

The tool tip works perfectly fine. It just won't seem to change position from the original right.

I am using:
Angular 1.3.16,
Bootstrap CSS & JS: 3.3.5,
and Django: 1.8

<a 
    class="about-social a-color" 
    tooltips 
    tooltip-title="Austin on Linkedin" 
    tooltip-size="small" 
    tootip-side="bottom"  
    href="https://www.linkedin.com/in/" 
    target="_blank">
        <span class="icon-linkedin"></span>
  </a>

screen shot 2015-08-20 at 3 29 06 pm

Show only if non-empty content

This module is great. The only thing I'm missing is some way to show the tooltip only if some criteria is met. What about having

<span tooltip-content="{{ data.comment }}"></span>

show a tooltip only if data.comment does not evaluate to false (blank/undefined, ...)?

Dynamically changing tooltip content on form errors

I am trying to integrate angular-tooltips with input form. I want to change tooltip text on registrationForm.email.$error object change.

HTML:
<input tooltips tooltip-html="{{ emailToolTip }}" tooltip-show-trigger="focus" tooltip-hide-trigger="blur" tooltip-side="right"/>
<div>{{emailToolTip}}</div>

Controller:

$scope.emailToolTip = 'Initial tooltip';
$scope.$watch('registrationForm.email.$error', function (newVal) {
  $scope.emailToolTip = 'Updated tooltip';
  }
}, true);

above code changes <div> value but it doesn't change <input>'s 'tooltip-html' attribute value. Am I missing anything or is it a bug?

IE support

Is there no work around to make it work in IE at all? Not even in IE11?
I did not realize there was a question mark on IE support, and its a little too late for me to go back:(

Resizing the screen with multiple tooltip cause performance issues

Great plugin btw, super easy to use!

I have this project with a lot of tooltips (a ng-repeat with tons of items) but when I get to 50+ items (so 100+ tooltips) and I resize the screen, it reinitialize all the tooltips and cause massive performance issue.

Thanks for looking in that issue

angular.element($window).bind('resize', onResize); seems to be the problem

Show tooltip on specific event/events

tooltip-show-trigger=""
tooltip-hide-trigger=""

can use single or multiple events to trigger the tooltip to show/hide (i.e: tooltip-show-trigger="mouseover click")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.