Bläddra i källkod

[core] Avoid RequireJS caching if django_debug_mode=true

Enrico Berti 10 år sedan
förälder
incheckning
e0181b9
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      desktop/core/src/desktop/templates/require.mako

+ 8 - 0
desktop/core/src/desktop/templates/require.mako

@@ -13,6 +13,11 @@
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
+<%!
+from desktop.conf import DJANGO_DEBUG_MODE
+DEBUG = DJANGO_DEBUG_MODE.get()
+%>
+
 
 <%def name="config()">
   <script src="${ static('desktop/ext/js/require.js') }"></script>
@@ -21,6 +26,9 @@
       return jQuery;
     });
     require.config({
+      %if DEBUG:
+      urlArgs: "bust=" + (new Date()).getTime(),
+      %endif
       baseUrl: "${ static('') }",
       paths: {
         "jquery.ui.sortable": "desktop/ext/js/jquery/plugins/jquery-ui-1.10.4.draggable-droppable-sortable.min",