using popover instead of tooltip
authorNicholas Bollweg (Nick) <nick.bollweg@gmail.com>
Wed, 14 May 2014 19:20:44 -0400
changeset 2154 523665ff5818
parent 2153 8d5d3b4c41d0
child 2155 a12ff6c6c901
using popover instead of tooltip
playground/playground.js
--- a/playground/playground.js	Wed May 14 19:19:43 2014 -0400
+++ b/playground/playground.js	Wed May 14 19:20:44 2014 -0400
@@ -850,19 +850,28 @@
 
     playground.permalink.title =  messages.danger + " " + messages.warning;
 
-    $("#permalink").tooltip({
+    $("#permalink").popover({
+      placement: "left",
       title: function(){
+        var title = $("<span/>");
+        title.append(
+          $("<span/>").text("Share this "),
+          $("<a/>", {
+            href: "http://tinyurl.com/create.php?url=" + loc +
+              hash.replace("#", "?"),
+              target: "_blank",
+              "class": "pull-right"
+          }).text("Shorten"));
+        return title[0];
+      },
+      content: function(){
         var tip = $("<p/>"),
           inp = $("<input/>", {
             "class": "span2",
             value: loc + hash,
             autofocus: true
           });
-        tip.append(
-          $("<span/>")
-            .text(playground.permalink.title.trim() + " Press Ctrl+C to copy."),
-          inp
-        );
+        tip.append(inp);
 
         setTimeout(function(){
           inp[0].select();