Skip to content

closeOnEscape property missing #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 75 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a6bcf2e
Update README.md
andrius-senulis Mar 30, 2016
85bb7ad
Merge branch 'jeremyVignelles-container-scroll'
sandywalker Apr 12, 2016
7ebdfc9
Merge pull request #156 from andrius-senulis/patch-1
sandywalker Apr 12, 2016
d0ab0b4
fix scroll problem
sandywalker Apr 12, 2016
ea4949c
1.2.7
sandywalker Apr 12, 2016
afaa54f
update history.md
sandywalker Apr 12, 2016
ac6df87
update version to 1.2.7
sandywalker Apr 12, 2016
98137f9
Merge branch 'master' of github.com:sandywalker/webui-popover
sandywalker Apr 12, 2016
0649daf
Honor CSS transformations of the element the popover is attached to.
anlumo Apr 20, 2016
26391a3
fixed position issue using container mode
jeremyVignelles May 2, 2016
393954f
take into account modifications of #160
jeremyVignelles May 2, 2016
ce6a7e6
forgot to save a comment before committing
jeremyVignelles May 2, 2016
e0d53bb
fix less collisions
sandywalker May 13, 2016
8a7ed85
Merge pull request #160 from anlumo/master
sandywalker May 13, 2016
f5a3f45
position bugfix
sandywalker May 13, 2016
e67070c
Merge pull request #161 from jeremyVignelles/container-position-bugfix
sandywalker May 13, 2016
63445ab
placement bugfix and add rtl support
sandywalker May 14, 2016
30dffb8
Merge branch 'master' of github.com:sandywalker/webui-popover
sandywalker May 14, 2016
07701db
fixed position bug
sandywalker May 26, 2016
9de2565
update version to 1.2.9
sandywalker May 26, 2016
94ac6f1
fix the hidden bug when trigger is manual
sandywalker May 26, 2016
c7d3e41
update version to 1.2.10
sandywalker May 26, 2016
768c1e5
add new test file
sandywalker May 26, 2016
baea82a
update bower version
sandywalker May 26, 2016
4523488
fix position bug with svg
sandywalker May 26, 2016
ae6756b
update version to 1.2.11
sandywalker May 26, 2016
0f794db
add canvas and svg test file
sandywalker May 26, 2016
bfb1ed6
Added support for hideEmpty
MikaelPorttila May 28, 2016
62002f9
Added hideEmpty option for pops (HTML content)
MikaelPorttila May 28, 2016
c84293c
Minor code clean up
MikaelPorttila May 28, 2016
cbb9e96
Merge pull request #172 from MikaelPorttila/master
sandywalker Jun 2, 2016
66d2cd2
add ajax data parameter
aborn Jun 2, 2016
586ffbc
add to on show
aborn Jun 2, 2016
ef21820
Merge pull request #173 from aborn/master
sandywalker Jun 23, 2016
5fd995f
fix: use single quotes
Jun 28, 2016
0edcf26
fix manual event triggers
Jun 28, 2016
2c9fa4a
Merge pull request #179 from lukasbesch/disable-event-listeners
sandywalker Jun 29, 2016
c14c8e0
add global object,fixed chache bugs
Jun 29, 2016
bae4c79
update readme doc
Jun 29, 2016
6009e3f
update readme doc
Jun 29, 2016
9fe79de
Remove non-essential files from npm package
jorrit Jun 30, 2016
0c5adcc
- add css width 99% to .webui-popover-content > div:first-child to pr…
migliori Jul 5, 2016
c4bf2fc
Merge pull request #181 from jorrit/patch-1
sandywalker Jul 25, 2016
38656a1
Merge pull request #184 from migliori/master
sandywalker Jul 25, 2016
f2760db
add new methods
sandywalker Jul 26, 2016
96932c3
fix the grammer problem
sandywalker Jul 26, 2016
b25daf8
update readme
sandywalker Jul 26, 2016
6a82d43
fix bugs,add new API and test htmls
sandywalker Aug 23, 2016
0e31c52
add selector option
sandywalker Sep 6, 2016
d1ab83e
fix grammer error
sandywalker Sep 6, 2016
7dcf0a8
update version to 1.2.14 and update the readme
sandywalker Sep 6, 2016
3c05aca
update version
sandywalker Sep 6, 2016
0731b69
fix hover bugs
sandywalker Sep 7, 2016
a519d5f
1.2.15
sandywalker Sep 7, 2016
de07af1
add main section
sandywalker Sep 8, 2016
e003edb
add maxHeight and maxWidth css properties support
limodou Oct 1, 2016
d9ee385
Better description of what `style` actually does.
w00fz Oct 13, 2016
0e9c7b4
Merge pull request #211 from w00fz/patch-1
sandywalker Oct 18, 2016
deb6cbe
Merge pull request #208 from limodou/patch-1
sandywalker Oct 18, 2016
bfcc6eb
add new test
sandywalker Oct 18, 2016
666704e
add new global method updateContentAsync
sandywalker Oct 18, 2016
2d9e0eb
add new demo resource
sandywalker Oct 18, 2016
dc224a9
fix isCreated method problem
sandywalker Oct 18, 2016
5e37fea
add new global method setDefaultOptions
sandywalker Oct 18, 2016
d8f5e15
update readme and history doc
sandywalker Oct 18, 2016
46d7943
Fix README
irazasyed Oct 18, 2016
5b5d322
Merge pull request #212 from irazasyed/patch-1
sandywalker Oct 19, 2016
cb50d98
Added settings object for beforeSend function parameters.
Dec 5, 2016
3a076f2
popover content callback support
iamdanthedev Dec 22, 2016
4060fa5
Merge pull request #216 from mnikkane/feature/add-settings-object-to-…
sandywalker Jan 20, 2017
af0d02b
Merge pull request #218 from rasdaniil/master
sandywalker Jan 20, 2017
c152c50
add new test file
sandywalker Jan 20, 2017
ca23e59
Merge branch 'master' of github.com:sandywalker/webui-popover
sandywalker Jan 20, 2017
c020b62
fix touch event bugs,fix cache bugs
sandywalker Jan 20, 2017
b02d6ba
update version to 1.2.18
sandywalker Jan 20, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
node_modules/
.DS_Store
*.sublime-project
*.sublime-workspace
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/
.DS_Store
*.sublime-project
*.sublime-workspace
.npmignore
.jshintrc
bower.json
CONTRIBUTING.md
Gruntfile.js
HISTORY.md
ROADMAP.md
webui-popover.jquery.json
demo
45 changes: 42 additions & 3 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@


# History
### 1.2.17
* fixed some bugs
* add new global method 'updateContentAsync' for async mode.
* add new global method 'setDefaultOptions'


### 1.2.16
* fixed some bugs.


### 1.2.14
* add global method 'updateContent'
* add new option: 'selector' for delegate, now the plugin can deal with dynamic created content.

### 1.2.13
* fix the arrow hidden bug in firefox
* fix the position bug when container's position is 'relative'
* add options to 'WebuiPopovers.show' method
* add 'WebuiPopovers.create','WebuiPopovers.isCreated' methods

### 1.2.11
* fix the position bug with svg.


### 1.2.10
* fix the hidden bug in show method when trigger is set to 'manual'.


### 1.2.9
* fix the position in container bug

### 1.2.8
* fix and optimize the scroll placement bug
* add rtl direction support
* fix arrow hide bug when placement is set to auto or auto-buttom
* fix the LESS variable collision


### 1.2.7
* fix the scroll placement bug

### 1.2.6
* fix the hidden bug on mobile device when trigger is set to 'hover'
Expand All @@ -14,10 +54,10 @@

### 1.2.3
* fix the bug which cause the popover hide by click when multi popovers in same page.
* optimize event handling for performance
* optimize event handling for performance

### 1.2.2
*
*
* optimize code and clean debug info

### 1.2.1
Expand All @@ -33,4 +73,3 @@
* new way to init popover content, set the content by next element html which has class 'webui-popover'.
* optimese the calulate position algorithm.
* update the demo page adapt for mobile device.

141 changes: 107 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WebUI-Popover
=============

A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary!
A lightWeight popover plugin with jquery, enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap, but bootstrap is not necessary!


Browser compatibility: ie8+,Chrome,Safari,Firefox,Opera
Expand Down Expand Up @@ -117,6 +117,21 @@ $('a').webuiPopover({content:'Content',trigger:'hover'});
$('a').webuiPopover({content:'Content',trigger:'sticky'});
```

Create Popover Dynamically (by new option:'selector').

```html
<a href="#" id="addPop" class="btn btn-default"> add Pop </a>
<div class="pops">

</div>
```

```javascript
$('#addPop').on('click',function(e){
$('<a href="#" class="show-pop data-placement="auto-bottom" data-title="Dynamic Title" data-content="Dynamic content"> Dynamic created Pop </a>').appendTo('.pops');
});
```

Popover with inversed style.
```javascript
$('a').webuiPopover({content:'Content',style:'inverse'});
Expand Down Expand Up @@ -178,45 +193,103 @@ $('a').webuiPopover({

```

Destroy the Popover
```javascript
$('a').webuiPopover('destroy');
```


### default options

### Default options
```javascript
{
placement:'auto',//values: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left,auto-top,auto-right,auto-bottom,auto-left,horizontal,vertical
placement:'auto',//values: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left,auto-top,auto-right,auto-bottom,auto-left,horizontal,vertical
container: document.body,// The container in which the popover will be added (i.e. The parent scrolling area). May be a jquery object, a selector string or a HTML element. See https://jsfiddle.net/1x21rj9e/1/
width:'auto',//can be set with number
height:'auto',//can be set with number
trigger:'click',//values: click,hover,manual(handle events by your self),sticky(always show after popover is created);
style:'',//values:'',inverse
animation:null, //pop with animation,values: pop,fade (only take effect in the browser which support css3 transition)
delay: {//show and hide delay time of the popover, works only when trigger is 'hover',the value can be number or object
show: null,
hide: 300
},
async: {
type:'GET', // ajax request method type, default is GET
before: function(that, xhr) {},//executed before ajax request
success: function(that, data) {}//executed after successful ajax request
error: function(that, xhr, data) {} //executed after error ajax request
},
cache:true,//if cache is set to false,popover will destroy and recreate
multi:false,//allow other popovers in page at same time
arrow:true,//show arrow or not
title:'',//the popover title ,if title is set to empty string,title bar will auto hide
content:'',//content of the popover,content can be function
closeable:false,//display close button or not
padding:true,//content padding
type:'html',//content type, values:'html','iframe','async'
url:'',//if type equals 'html' , value should be jQuery selecor. if type equels 'async' the plugin will load content by url.
backdrop:false,//if backdrop is set to true, popover will use backdrop on open
dismissible:true, // if popover can be dismissed by outside click or escape key
autoHide:false, // automatic hide the popover by a specified timeout, the value must be false,or a number(1000 = 1s).
offsetTop:0, // offset the top of the popover
offsetLeft:0, // offset the left of the popover
onShow: function($element) {}, // callback after show
onHide: function($element) {}, // callback after hide
width:'auto',//can be set with number
height:'auto',//can be set with number
trigger:'click',//values: click,hover,manual(handle events by your self),sticky(always show after popover is created);
selector:false,// jQuery selector, if a selector is provided, popover objects will be delegated to the specified.
style:'',// Not to be confused with inline `style=""`, adds a classname to the container for styling, prefixed by `webui-popover-`. Default '' (light theme), 'inverse' for dark theme
animation:null, //pop with animation,values: pop,fade (only take effect in the browser which support css3 transition)
delay: {//show and hide delay time of the popover, works only when trigger is 'hover',the value can be number or object
show: null,
hide: 300
},
async: {
type:'GET', // ajax request method type, default is GET
before: function(that, xhr, settings) {},//executed before ajax request
success: function(that, data) {}//executed after successful ajax request
error: function(that, xhr, data) {} //executed after error ajax request
},
cache:true,//if cache is set to false,popover will destroy and recreate
multi:false,//allow other popovers in page at same time
arrow:true,//show arrow or not
title:'',//the popover title, if title is set to empty string,title bar will auto hide
content:'',//content of the popover,content can be function
closeable:false,//display close button or not
direction:'', // direction of the popover content default is ltr ,values:'rtl';
padding:true,//content padding
type:'html',//content type, values:'html','iframe','async'
url:'',//if type equals 'html', value should be jQuery selecor. if type equels 'async' the plugin will load content by url.
backdrop:false,//if backdrop is set to true, popover will use backdrop on open
dismissible:true, // if popover can be dismissed by outside click or escape key
autoHide:false, // automatic hide the popover by a specified timeout, the value must be false,or a number(1000 = 1s).
offsetTop:0, // offset the top of the popover
offsetLeft:0, // offset the left of the popover
onShow: function($element) {}, // callback after show
onHide: function($element) {}, // callback after hide
}
```

###Global Methods


In some situation, you may want to manipulate the plugin like 'show/hide' popovers by global methods. The new object **WebuiPopovers** is introduced and exposed to the global window object, so you can access these methods like 'WebuiPopovers.someMethod()...'.

Here are examples of calling code.

```javascript

//Show Popover by click other element.
$('a').on('click',function(e){
e.stopPropagation(); // Stop event propagation is needed, otherwise may trigger the document body click event handled by plugin.
WebuiPopovers.show('#el');
});

// Show Popover with options
WebuiPopovers.show('#el',{title:' hello popover',width:300});


//Hide Popover by jQuery selector
WebuiPopovers.hide('#el');

//Hide All Popovers
WebuiPopovers.hideAll();

//Update the Popover content
WebuiPopovers.updateContent('.btn-showpop','some html or text');


//Update the Popover content async
WebuiPopovers.updateContentAsync('.btn-showpop','http://someUrl');

//Set global default options
WebuiPopovers.setDefaultOptions(options);
```

Full Methods

```js
WebuiPopovers.show(selector,options); // Show popover by jQuery selector,the options parameter is optional
WebuiPopovers.hide(selector); // Hide popover by jQuery selector
WebuiPopovers.hideAll(); // Hide all popovers
WebuiPopovers.create(selector,options);// Create and init the popover by jQuery selector.
WebuiPopovers.isCreated(selector); // Check if the popover is already create and bind to the selector.
WebuiPopovers.updateContent(selector,newContent) //Update the Popover content after the popover is created.
WebuiPopovers.updateContentAsync(selector,url) //Update the Popover content asynchronously after the popover is created.
WebuiPopovers.setDefaultOptions(options) //Change the global default options.
```



Welcome to visit my github page: [http://sandywalker.github.io/]
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webui-popover",
"version": "1.2.6",
"version": "1.2.18",
"authors": [
"sandywalker <[email protected]>"
],
Expand Down
4 changes: 4 additions & 0 deletions demo/async-content-another.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h3>Another Async Content </h3>
<p>
A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features.
</p>
4 changes: 4 additions & 0 deletions demo/async-content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h3>Async Content</h3>
<p>
A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary!
</p>
Loading