Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Partially working with IE #310

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Partially working with IE #310

wants to merge 8 commits into from

Conversation

liquiddc
Copy link

Hi These changes incorporate the eventsource polyfill from yaffle to make dashing almost work on IE. Creating a new dashing dashboard with this branch shows the chart part of the convergence widget working on IE (and nothing broken on other browsers). This proves the jobs send event data is being picked up by the eventsource in IE. But none of the batman bindings seem to work so the other widgets don't work. There are no errors logged to the js console in IE and it's not immediately obvious to me how to debug this problem in any more depth.

@bielfrontera
Copy link

Hi!
I think I've found why widgets are not loaded in IE. The problem is that object.constructor.name doesn't work in IE. This property is used at dashing.coffee:

class Dashing.Widget extends Batman.View
  constructor:  ->
    # Set the view path
    @constructor::source = Batman.Filters.underscore(@constructor.name)
    super

You can patch IE following this instructions: http://matt.scharley.me/2012/03/09/monkey-patch-name-ie.html (via stackoverflow )

@bielfrontera
Copy link

The patch I suggested before does not work when code is minified. I've finally added this method to Dashing.widget class:

  getName: () =>
    funcNameRegex = /function ([^\(]{1,})\(/;
    results = (funcNameRegex).exec(@constructor.toString())
    if (results && results.length > 1) then results[1].trim() else ""

And changed constructor.name by getName() at the class constructor method.

I've tested in Firefox, Chrome and Internet Explorer (10 and 11) and it works with javascript minified (attention, the code is not uglified).

@anweiss
Copy link

anweiss commented Feb 13, 2014

I'm noticing that even the Sample dashboard still does not work in IE11, despite this fix.

bielfrontera added a commit to bielfrontera/dashing that referenced this pull request Feb 14, 2014
Replace constructor.name with a new function called getName that works on Internet Explorer.
This new function is based on this workaround to support Function.name: http://matt.scharley.me/2012/03/09/monkey-patch-name-ie.html

Combined with PR Shopify#310, the library works fine on IE.

Disclaimer: I do not use Internet Explorer! However, I developed a TV panel using your library, and now we have to support IE...
@bielfrontera
Copy link

I've tried on IE11 after applying @liquiddc changes and constructor.name replacement and it works:

dashing_sample_ie11

bielfrontera pushed a commit to socib/seaboard that referenced this pull request May 9, 2014
Widgets didn't load at IE. It was a problem of dashing library.
See Shopify/dashing#310 (comment)
Floppy added a commit to theodi/dashing that referenced this pull request Jun 23, 2014
@Floppy
Copy link

Floppy commented Jun 23, 2014

Verified this is working for me in IE11. I have a branch with both the @liquiddc and @bielfrontera changes in, and it's working just fine: https://github.com/theodi/dashing/tree/ie. Thanks guys!

Floppy added a commit to theodi/dashboards that referenced this pull request Jun 23, 2014
@terraboops
Copy link
Contributor

Either this or #322 should be merged. This PR seems to be more comprehensive and well-tested.

Will have to look at this in greater detail to decide which is better.

@ghost
Copy link

ghost commented Jul 28, 2015

@tylermauthe any update? would be nice to have it merged.

@cjdcordeiro
Copy link

Hi,

many thanks for that fix.
One thing though, what about Microsoft Edge? I see this fix does not make it work with Edge...any suggestions?

@lunarose23
Copy link

Any news on this? if we decide to go with dashing I may be forking and doing this. But want to make sure before I spend time on it that someone already didn't and it has some sort of block.

Copy link
Contributor

@terraboops terraboops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫

@christianhau
Copy link

Would love to get an update on this as I have a dashboard that I have to how in IE that currently doesn't work.. Thanks in advance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants