Skip to content

Commit

Permalink
Fix internet explorer problem with constructor.name
Browse files Browse the repository at this point in the history
Widgets didn't load at IE. It was a problem of dashing library.
See Shopify/dashing#310 (comment)
  • Loading branch information
Biel Frontera committed Feb 11, 2014
1 parent d46b519 commit 342c661
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions seawidgets/static/js/dashing.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ if (Function.prototype.name === undefined && Object.defineProperty !== undefined

Widget.prototype.onData = function(data) {};

Widget.prototype.getName = function() {
var funcNameRegex = /function ([^\(]{1,})\(/;
var results = (funcNameRegex).exec((this).constructor.toString());
return (results && results.length > 1) ? results[1].trim() : "";
};

return Widget;

})(Batman.View);
Expand Down
6 changes: 3 additions & 3 deletions seawidgets/templates/layout-empty.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@

<!-- Javascript placed at the end of the document so the pages load faster -->
{% compress js %}
<script type="text/javascript" src="{% static "js/jquery-2.0.0.min.js" %}"></script>
<!-- script type="text/javascript" src="{% static "js/jquery-1.11.0.min.js" %}"></script -->
<!-- script type="text/javascript" src="{% static "js/jquery-2.0.0.min.js" %}"></script -->
<script type="text/javascript" src="{% static "js/jquery-1.11.0.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/es5-shim.js" %}"></script>
<script type="text/javascript" src="{% static "js/batman.js" %}"></script>
<script type="text/javascript" src="{% static "js/underscore-min.js" %}"></script>
<script type="text/javascript" src="{% static "js/date.format.js" %}"></script>
<script type="text/javascript" src="{% static "bootstrap/js/bootstrap.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/batman.js" %}"></script>
<script type="text/javascript" src="{% static "js/batman.jquery.js" %}"></script>
<script type="text/javascript" src="{% static "js/dashing.js" %}"></script>
{% endcompress %}
Expand Down

0 comments on commit 342c661

Please sign in to comment.