mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 00:48:55 +00:00
jappixmini: include jappix source
This commit is contained in:
parent
61eb1f0d18
commit
302b2820d1
231 changed files with 96082 additions and 2 deletions
59
jappixmini/jappix/js/bubble.js
Normal file
59
jappixmini/jappix/js/bubble.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
|
||||
Jappix - An open social platform
|
||||
These are the bubble JS scripts for Jappix
|
||||
|
||||
-------------------------------------------------
|
||||
|
||||
License: AGPL
|
||||
Author: Vanaryon
|
||||
Last revision: 11/12/10
|
||||
|
||||
*/
|
||||
|
||||
// Closes all the opened bubbles
|
||||
function closeBubbles() {
|
||||
// Destroy all the elements
|
||||
$('.bubble.hidable:visible').hide();
|
||||
$('.bubble.removable').remove();
|
||||
$('body').die('click');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Click function when a bubble is opened
|
||||
function showBubble(selector) {
|
||||
// Hidable bubbles special things
|
||||
if($(selector).is('.hidable')) {
|
||||
// This bubble is yet displayed? So abort!
|
||||
if($(selector).is(':visible'))
|
||||
return closeBubbles();
|
||||
|
||||
// Close all the bubbles
|
||||
closeBubbles();
|
||||
|
||||
// Show the requested bubble
|
||||
$(selector).show();
|
||||
}
|
||||
|
||||
// Removable bubbles special things
|
||||
else {
|
||||
// This bubble is yet added? So abort!
|
||||
if(exists(selector))
|
||||
return closeBubbles();
|
||||
|
||||
// Close all the bubbles
|
||||
closeBubbles();
|
||||
}
|
||||
|
||||
// Creates a new click event to close the bubble
|
||||
$('body').live('click', function(evt) {
|
||||
var target = evt.target;
|
||||
|
||||
// If this is a click away from a bubble
|
||||
if(!$(target).parents('.ibubble').size())
|
||||
closeBubbles();
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue