inspector-gadget

WebJar for inspector-gadget

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

inspector-gadget
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

inspector-gadget
WebJar for inspector-gadget
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/softwaredoug/inspector-gadget

Download inspector-gadget

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/inspector-gadget/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>inspector-gadget</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/inspector-gadget/
implementation 'org.webjars.bower:inspector-gadget:0.2.0'
// https://jarcasting.com/artifacts/org.webjars.bower/inspector-gadget/
implementation ("org.webjars.bower:inspector-gadget:0.2.0")
'org.webjars.bower:inspector-gadget:jar:0.2.0'
<dependency org="org.webjars.bower" name="inspector-gadget" rev="0.2.0">
  <artifact name="inspector-gadget" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='inspector-gadget', version='0.2.0')
)
libraryDependencies += "org.webjars.bower" % "inspector-gadget" % "0.2.0"
[org.webjars.bower/inspector-gadget "0.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.2.0,1.3)
org.webjars.bower : jquery jar [2.1.1,2.2)
org.webjars.bower : bootstrap jar [3.2.0,3.3)

Project Modules

There are no modules declared in this project.

Inspector Gadget

Better AngularJS Popover with HTML content. I frequently need a richer popover experience than the one angular-ui bootstrap provides. So I thought I'd open source our implementation! See a few demos.

Build Status

Dependencies

You'll need all the dependencies of bootstrap's popover plus angular:

  • required:
    • bootstrap (js and css)
    • angular
    • jquery

Install

bower install inspector-gadget --save

Documentation

Add the minified JS:

<script type="text/javascript" src="bower-components/inspector-gadget/inspector-gadget.min.js"></script>

Add the directive to your app's module:

angular.module('myApp', [
    'ngRoute', 'ngSanitize', ...
    'swd.inspector-gadget'  // ADD ME!
]).

Use the directive:

<inspector-gadget>
    <a href="#">Hover Me!</a>
    <inspector-title>
      I'm the popover's <em>title</em>!
    </inspector-title>
    <inspector-content>
      <ul>
      	Hello <em>World!</em>
      	<li ng-repeat="i in [1,2,3]">{{i}}</li>
      </ul>
    </inspector-content>
</inspector-gadget>

We support most paramaters supported by bootstap's popover. Simply apply the corresponding parameter to the inspector-gadget tag:

<inspector-gadget data-placement="bottom" data-container="body">
...

We also support a timeout parameter which specifies in milliseconds how long after hovering off the anchor until the popover is hidden. The default value is 500 ms. Specify it as follows:

<inspector-gadget data-placement="bottom" data-container="body" data-timeout="1000">
...

Limitations

My boss calls these "opportunities for improvement".

Hovers Only

Currently, inspector-gadget only responds to hovers. We built this in part to do smarter hovering. So we currently only implement our own custom hovering style, which keeps the popover open even as you hover the popover. I plan on looking into getting other bootstrap triggers implemented.

A note on styling

Dont style using inspector-* tags, use the bootstrap popover classes (.popover, .popover-anchor, .popver-title, .popover-content) if you need to style or otherwise interact with that whole div. Or add your own classes/ids/etc to content within the popover.

What's popover-anchor?

This corresponds to the content anchored to the page. What you hover over. Use it to style this entire div.

If popovers are appearing at wierd places, remember its this div that matters. This div flows onto the page as a regular div, its up to you to size it correctly.

A common thing you may wish to do is style this div to shrink to the content. IE

.popover-content {
   display: inline-block
}

Sponsors

This project was developed for our search relevancy tuning tools Quepid and Splainer -- all while doing work for our Solr and Elasticsearch consulting firm OpenSource Connections

Versions

Version
0.2.0