forked from Botanical/BotanJS
UserComment subscription
This commit is contained in:
@@ -98,16 +98,17 @@
|
||||
|
||||
for( var i in e.data )
|
||||
{
|
||||
var data = e.data[i];
|
||||
var li
|
||||
, li_s = [
|
||||
// On/off toggle
|
||||
Dand.wrap( "span", null, "nt_switch" )
|
||||
, Dand.wrap( "span", null, "nt_tname", e.data[i].name )
|
||||
, Dand.wrap( "span", null, "nt_tname", data.name )
|
||||
]
|
||||
, keys = [ new DataKey( "tid", i ) ]
|
||||
, keys = [ new DataKey( "tid", data.type ) ]
|
||||
;
|
||||
|
||||
if( e.data[i].hasOwnProperty("count") )
|
||||
if( data.hasOwnProperty("count") )
|
||||
{
|
||||
// type count
|
||||
li_s[2] = Dand.wrap(
|
||||
@@ -115,7 +116,7 @@
|
||||
, null
|
||||
, "nt_tcount"
|
||||
, e.data[i].count + ""
|
||||
, new DataKey( "count", e.data[i].count )
|
||||
, new DataKey( "count", data.count )
|
||||
);
|
||||
// Active
|
||||
keys[ keys.length ] = new IKey( "active", 1 );
|
||||
@@ -152,6 +153,7 @@
|
||||
var createContextMenu = function(e)
|
||||
{
|
||||
var items = [], menuShow = false;
|
||||
var hasNotis = 0 < e.data.length;
|
||||
|
||||
for( var n in e.data )
|
||||
{
|
||||
@@ -159,7 +161,7 @@
|
||||
var data = e.data[n];
|
||||
// Create items
|
||||
items[ items.length ] = new IKey(
|
||||
data.message
|
||||
data.mesg
|
||||
, new EventKey(
|
||||
"m_" + data.id
|
||||
, readNotification.bind( data )
|
||||
@@ -177,10 +179,10 @@
|
||||
// showMenu/hideMenu overrides style settings
|
||||
, {
|
||||
"class": "nt_container"
|
||||
, "showMenu": function(stage, event)
|
||||
, "showMenu": function( stage, event )
|
||||
{
|
||||
if( stage.className == "nt_date" ) return;
|
||||
if( menuShow ) return;
|
||||
if( !hasNotis || menuShow ) return;
|
||||
bodyStyle.marginLeft = "1em";
|
||||
bodyStyle.marginRight = "-1em";
|
||||
bodyStyle.opacity = 0;
|
||||
@@ -194,7 +196,7 @@
|
||||
menuShow = true;
|
||||
});
|
||||
}
|
||||
, "hideMenu": function(stage)
|
||||
, "hideMenu": function( stage )
|
||||
{
|
||||
if( stage.className == "nt_date" ) return;
|
||||
if( !menuShow ) return;
|
||||
|
||||
Reference in New Issue
Block a user