// Generated by CoffeeScript 1.10.0
(function() {
  angular.module('ngQtip2', []).directive('qtip', [
    '$timeout', '$compile', '$http', '$templateCache', function($timeout, $compile, $http, $templateCache) {
      return {
        restrict: 'A',
        scope: {
          qtipVisible: '=',
          qtipDisable: '=',
          qtipFixed: '=',
          qtipDelay: '=',
          qtipAdjustX: '=',
          qtipAdjustY: '=',
          qtipModalStyle: '=',
          qtipTipStyle: '=',
          qtip: '@',
          qtipTitle: '@',
          qtipTarget: '@',
          qtipContent: '@',
          qtipSelector: '@',
          qtipTemplate: '@',
          qtipEvent: '@',
          qtipEventOut: '@',
          qtipHide: '=',
          qtipShow: '=',
          qtipClass: '@',
          qtipMy: '@',
          qtipAt: '@',
          qtipOptions: '=',
          object: '=qtipTemplateObject'
        },
        link: function(scope, el, attrs) {
          var content, event, eventOut, generateQtip, ref, str2bool;
          str2bool = function(str) {
            var ref;
            return (ref = String(str).toLowerCase()) !== 'false' && ref !== '0' && ref !== 'null' && ref !== '';
          };
          if (scope.qtipEvent === 'false') {
            event = false;
          }
          if (scope.qtipEventOut === 'false') {
            eventOut = false;
          }
          scope.closeQtip = function(e, id) {
            if (id == null) {
              id = el.data('hasqtip');
            }
            if (e != null) {
              if (typeof e.preventDefault === "function") {
                e.preventDefault();
              }
            }
            $("#qtip-" + id).qtip('hide');
            return void 0;
          };
          generateQtip = function(content) {
            var options, ref, ref1, ref2, ref3, ref4, ref5, ref6;
            options = {
              position: {
                my: (ref = scope.qtipMy) != null ? ref : 'bottom center',
                at: (ref1 = scope.qtipAt) != null ? ref1 : 'top center',
                target: (ref2 = scope.qtipTarget) != null ? ref2 : el,
                adjust: {
                  x: scope.qtipAdjustX != null ? parseInt(scope.qtipAdjustX) : 0,
                  y: scope.qtipAdjustY != null ? parseInt(scope.qtipAdjustY) : 0
                }
              },
              show: {
                event: str2bool(scope.qtipEvent) ? scope.qtipEvent : 'mouseover'
              },
              hide: {
                fixed: scope.qtipFixed !== null ? str2bool(scope.qtipFixed) : true,
                delay: (ref3 = scope.qtipDelay) != null ? ref3 : 100,
                event: str2bool(scope.qtipEventOut) ? scope.qtipEventOut : 'mouseout'
              },
              style: {
                classes: str2bool(scope.qtipClass) ? scope.qtipClass : 'qtip',
                modal: (ref4 = scope.qtipModalStyle) != null ? ref4 : {},
                tip: (ref5 = scope.qtipTipStyle) != null ? ref5 : {}
              }
            };
            if (scope.qtipHide != null) {
              options.hide = scope.qtipHide;
            }
            if (scope.qtipShow != null) {
              options.show = scope.qtipShow;
            }
            if (scope.qtipOption != null) {
              options = angular.extend({}, option, scope.qtipOptions);
            }
            options.content = content != null ? content : {
              text: (ref6 = scope.qtipContent) != null ? ref6 : scope.qtip
            };
            $(el).qtip(options);
            if (attrs.qtipVisible) {
              scope.$watch('qtipVisible', function(new_val) {
                return $(el).qtip('toggle', new_val);
              });
            }
            if (attrs.qtipDisable) {
              scope.$watch('qtipDisable', function(new_val) {
                return $(el).qtip('disable', new_val);
              });
            }
            if (attrs.qtipTitle) {
              scope.$watch('qtipTitle', function(new_val) {
                return $(el).qtip('option', 'content.title', new_val);
              });
            }
            return scope.$watch('qtip', function(new_val, old_val) {
              if (new_val !== old_val) {
                return $(el).qtip('option', 'content.text', new_val);
              }
            });
          };
          if (attrs.qtipSelector) {
            $timeout((function() {
              return generateQtip($(scope.qtipSelector).html());
            }), 1);
          } else if (attrs.qtipTemplate) {
            $http.get(scope.qtipTemplate, {
              cache: $templateCache
            }).then(function(html) {
              return generateQtip({
                text: function() {
                  return $timeout(function() {
                    return scope.$apply(function() {
                      var text;
                      text = $compile(html.data)(scope);
                      return text;
                    });
                  }, 1);
                }
              });
            });
          } else if (attrs.qtipTitle) {
            generateQtip({
              title: scope.qtipTitle,
              text: scope.qtip
            });
          } else {
            content = (ref = scope.qtip) != null ? ref : scope.qtipContent;
            generateQtip({
              text: function() {
                return $timeout(function() {
                  return scope.$apply(function() {
                    return $compile("<div>" + content + "</div>")(scope);
                  });
                }, 1);
              }
            });
          }
          return void 0;
        }
      };
    }
  ]);

}).call(this);

@@ -3248,16 +3248,17 @@
 ipOption
+s
  != null
@@ -3310,16 +3310,17 @@
 , option
+s
 , scope.

Patch options bug