Quantcast
Channel: Dave Burke » .NET
Viewing all articles
Browse latest Browse all 10

Sueetie Activity Popup Notification jQuery Coexistence

$
0
0

A new feature coming in Sueetie v3.3 is Site Activity Popup Notifications.  This keeps everyone informed of the action without having to reload the page to monitor the Site Activity log.  Here’s an example of a Notification Popup.

Everything was jake with the Notification Popups on Sueetie.com until I noticed that a jQuery Media Set app I wrote and inserted into a ScrewTurn Wiki Page wasn’t displaying the images.  This is what it’s supposed to look like. 

The problem was that the Site Notification Script and the Media Set jQuery were fighting over the same PageLoad() CPU time.  I know javascript supports multiple PageLoad() functions in theory, but things aren’t always harmonious on the client side.  PageLoad(), $(document).ready(function() {}, it don’t matter.  We’re not always going to get along. Site Activity Popup Notifications depend on a javascript SetInterval() call in PageLoad() and the Media Set app needed PageLoad() to load its images and add some supporting functions.  First one to reach 500 feet won. 

It’s all good again. The Popup Notification is no longer in conflict with the Media Set app or any other PageLoad() dependent script.  The solution was to redesign the ASPNET Notification Control to render in two sections, a PageLoad() section and the support function section.  A new property called "UsePageLoadSetInterval" was added to determine how the Control will render.  It is set to true by default.

Here’s an example of using the "UsePageLoadSetInterval" property in the Notification Control.

Image

Since the ASPNET Control is no longer rendering the PageLoad() script we’re going to manually add the Notifier’s SetInterval() Code in the Media Set app’s PageLoad() script.

Image

You want to experiment with this yourself, I’m sure.  Don’t worry. Version 3.3 is coming soon!


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images