Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit bccc4ed

Browse files
committed
Fix tile.js for flat links.
1 parent 725bbf0 commit bccc4ed

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
django-ajax-tile
22
================
33

4+
Use https://github.com/defunkt/jquery-pjax/ instead.
5+
46
Installation
57
============
68

src/tile/static/tile/tile.js

+3-17
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,9 @@
156156
// No previous 'state' was stored, so use raw HTML.
157157
// Will execute script in HTML.
158158
// Need to fix.... back after refresh!
159-
$(state.currentSelector).html(state.currentHTML);
160-
$(state.currentHTML).filter("script").each(function(){
161-
if(this.src) {
162-
var script = document.createElement('script');
163-
var i, attrName, attrValue, attrs = this.attributes;
164-
for(i = 0; i < attrs.length; i++) {
165-
attrName = attrs[i].name;
166-
attrValue = attrs[i].value;
167-
script[attrName] = attrValue;
168-
}
169-
$(state.currentSelector)[0].append(script);
170-
}
171-
else {
172-
$.globalEval(this.text || this.textContent || this.innerHTML || '');
173-
}
174-
});
175-
159+
if (previousState) {
160+
$(state.currentSelector).html(state.currentHTML);
161+
}
176162
}
177163
else {
178164
// Previous 'state' (may have user input data).

0 commit comments

Comments
 (0)