Comparing version 0.0.11 to 0.0.12
@@ -27,10 +27,12 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
this.renderBox(); | ||
this.bindForm(); | ||
this.ref.off('child_added', this.onMessage); | ||
this.ref.limitToFirst(100).on('child_added', this.onMessage); | ||
if (!this.config.delayRender) { | ||
this.render(); | ||
} | ||
} | ||
initFirebase() { | ||
if (!window.firebase) { | ||
return false; | ||
} | ||
if (!this.db) { | ||
@@ -47,2 +49,5 @@ var app = window.firebase.initializeApp(this.config.firebase); | ||
this.ref = this.db.ref(`trollbox/${channel}`); | ||
this.ref.off('child_added', this.onMessage); | ||
this.ref.limitToFirst(100).on('child_added', this.onMessage); | ||
} | ||
@@ -78,2 +83,7 @@ | ||
render() { | ||
this.renderBox(); | ||
this.bindForm(); | ||
} | ||
renderBox() { | ||
@@ -83,2 +93,6 @@ const selector = this.config.container; | ||
if (!this.container) { | ||
return false; | ||
} | ||
// ugly, quick, and dirty | ||
@@ -85,0 +99,0 @@ this.container.innerHTML = ` |
@@ -15,3 +15,4 @@ var testing = false | ||
channel: 'demo', | ||
user: 'anon' | ||
user: 'anon', | ||
delayRender: false | ||
} | ||
@@ -18,0 +19,0 @@ |
{ | ||
"name": "trollbox", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle.js", |
@@ -26,11 +26,12 @@ class Trollbox { | ||
this.renderBox() | ||
this.bindForm() | ||
this.ref.off('child_added', this.onMessage) | ||
this.ref.limitToFirst(100) | ||
.on('child_added', this.onMessage) | ||
if (!this.config.delayRender) { | ||
this.render() | ||
} | ||
} | ||
initFirebase () { | ||
if (!window.firebase) { | ||
return false | ||
} | ||
if (!this.db) { | ||
@@ -47,2 +48,6 @@ var app = window.firebase.initializeApp(this.config.firebase) | ||
this.ref = this.db.ref(`trollbox/${channel}`) | ||
this.ref.off('child_added', this.onMessage) | ||
this.ref.limitToFirst(100) | ||
.on('child_added', this.onMessage) | ||
} | ||
@@ -78,2 +83,7 @@ | ||
render () { | ||
this.renderBox() | ||
this.bindForm() | ||
} | ||
renderBox () { | ||
@@ -83,2 +93,6 @@ const selector = this.config.container | ||
if (!this.container) { | ||
return false | ||
} | ||
// ugly, quick, and dirty | ||
@@ -85,0 +99,0 @@ this.container.innerHTML = ` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
315957
373