Skip to content

Commit 342c661

Browse files
author
Biel Frontera
committed
Fix internet explorer problem with constructor.name
Widgets didn't load at IE. It was a problem of dashing library. See Shopify/dashing#310 (comment)
1 parent d46b519 commit 342c661

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

seawidgets/static/js/dashing.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ if (Function.prototype.name === undefined && Object.defineProperty !== undefined
105105

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

108+
Widget.prototype.getName = function() {
109+
var funcNameRegex = /function ([^\(]{1,})\(/;
110+
var results = (funcNameRegex).exec((this).constructor.toString());
111+
return (results && results.length > 1) ? results[1].trim() : "";
112+
};
113+
108114
return Widget;
109115

110116
})(Batman.View);

seawidgets/templates/layout-empty.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949

5050
<!-- Javascript placed at the end of the document so the pages load faster -->
5151
{% compress js %}
52-
<script type="text/javascript" src="{% static "js/jquery-2.0.0.min.js" %}"></script>
53-
<!-- script type="text/javascript" src="{% static "js/jquery-1.11.0.min.js" %}"></script -->
52+
<!-- script type="text/javascript" src="{% static "js/jquery-2.0.0.min.js" %}"></script -->
53+
<script type="text/javascript" src="{% static "js/jquery-1.11.0.min.js" %}"></script>
5454
<script type="text/javascript" src="{% static "js/es5-shim.js" %}"></script>
55-
<script type="text/javascript" src="{% static "js/batman.js" %}"></script>
5655
<script type="text/javascript" src="{% static "js/underscore-min.js" %}"></script>
5756
<script type="text/javascript" src="{% static "js/date.format.js" %}"></script>
5857
<script type="text/javascript" src="{% static "bootstrap/js/bootstrap.min.js" %}"></script>
58+
<script type="text/javascript" src="{% static "js/batman.js" %}"></script>
5959
<script type="text/javascript" src="{% static "js/batman.jquery.js" %}"></script>
6060
<script type="text/javascript" src="{% static "js/dashing.js" %}"></script>
6161
{% endcompress %}

0 commit comments

Comments
 (0)