removed logs from eventHandler
This commit is contained in:
1 parent
9863485e91
commit
10b1a6511f
2 files changed
+1
-25
No files matched your search
@@ -1,7 +1,5 @@
|
||||
|
||||
function newEventHandler () {
|
||||
const CONSOLE_LOG = false
|
||||
|
||||
let thisObject = {
|
||||
name: undefined, // This is for debugging purposes only.
|
||||
parentEventHandler: undefined, // Here we store the parent cointainer zoom object.
|
||||
@@ -21,10 +19,6 @@ function newEventHandler () {
|
||||
|
||||
function listenToEvent (eventType, handler, extraData) {
|
||||
eventHandlers.push([eventType, handler, extraData])
|
||||
|
||||
if (thisObject.name !== undefined && CONSOLE_LOG === true) {
|
||||
console.log('Event Handler named ' + thisObject.name + ' received a request to listenToEvent ' + eventType + ' and call ' + (handler.toString()).substring(0, 50))
|
||||
}
|
||||
}
|
||||
|
||||
function stopListening (pEventType, pHandler) {
|
||||
@@ -32,10 +26,6 @@ function newEventHandler () {
|
||||
pHandler = 'Anonymous Function'
|
||||
}
|
||||
|
||||
if (thisObject.name !== undefined && CONSOLE_LOG === true) {
|
||||
console.log('Event Handler named ' + thisObject.name + ' received a request to stop listening to an the event ' + pEventType + ' with this handler: ' + pHandler)
|
||||
}
|
||||
|
||||
for (let i = 0; i < eventHandlers.length; i++) {
|
||||
let record = eventHandlers[i]
|
||||
let eventType = record[0]
|
||||
@@ -45,18 +35,12 @@ function newEventHandler () {
|
||||
if (pEventType === eventType) {
|
||||
eventHandlers.splice(i, 1)
|
||||
|
||||
if (thisObject.name !== undefined && CONSOLE_LOG === true) {
|
||||
console.log('Evethandler found and deleted.')
|
||||
}
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (pEventType === eventType && pHandler.toString() === handler.toString()) {
|
||||
eventHandlers.splice(i, 1)
|
||||
|
||||
if (thisObject.name !== undefined && CONSOLE_LOG === true) {
|
||||
console.log('Evethandler found and deleted.')
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -64,10 +48,6 @@ function newEventHandler () {
|
||||
}
|
||||
|
||||
function raiseEvent (eventType, event) {
|
||||
if (thisObject.name !== undefined && CONSOLE_LOG === true) {
|
||||
console.log('Event Handler named ' + thisObject.name + ' received a request to raiseEvent ' + eventType + ' with this data ' + (event.toString()).substring(0, 50))
|
||||
}
|
||||
|
||||
for (var i = 0; i < eventHandlers.length; i++) {
|
||||
/* We will execute all the functions listening to this event type. */
|
||||
|
||||
@@ -75,10 +55,6 @@ function newEventHandler () {
|
||||
var handler = eventHandlers[i][1]
|
||||
var extraData = eventHandlers[i][2]
|
||||
|
||||
if (thisObject.name !== undefined && CONSOLE_LOG === true) {
|
||||
console.log('Event Handler named ' + thisObject.name + ' received a request to raiseEvent ' + eventType + ' and will call this handler: ' + (handler.toString()).substring(0, 50))
|
||||
}
|
||||
|
||||
handler(event, extraData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
if (bot.products !== undefined) {
|
||||
for (let k = 0; k < bot.products.length; k++) {
|
||||
let product = bot.products[k]
|
||||
if (product.shareWith !== 'Public' && devTeam.codeName !== userTeam.slug) { continue }
|
||||
// if (product.shareWith !== 'Public' && devTeam.codeName !== userTeam.slug) { continue }
|
||||
/* Now we create Product objects */
|
||||
|
||||
let productCard = newProductCard()
|
||||
|
||||
Reference in new issue
Block a user