[extensions-web] Remove the document-ready handler for the regular details view
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Remove the document-ready handler for the regular details view
- Date: Mon, 14 Nov 2011 14:39:47 +0000 (UTC)
commit 3bc6f2b5b4c33c720707072d1e20ff92f2161eca
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Nov 13 22:57:37 2011 -0500
Remove the document-ready handler for the regular details view
.../extensions/templates/extensions/detail.html | 14 +-------------
sweettooth/static/js/main.js | 9 +++++++--
2 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/sweettooth/extensions/templates/extensions/detail.html b/sweettooth/extensions/templates/extensions/detail.html
index 49ddf9e..e04171f 100644
--- a/sweettooth/extensions/templates/extensions/detail.html
+++ b/sweettooth/extensions/templates/extensions/detail.html
@@ -26,7 +26,7 @@
data-uuid="{{ extension.uuid }}"
data-sv="{{ version.shell_versions_json }}"
data-pk="{{ version.pk }}">
- <div class="switch"></div>
+ <div class="switch{% if is_rejected %} insensitive{% endif %}"></div>
{% block icon %}
<img src="{{ extension.icon.url }}" class="icon">
@@ -66,17 +66,5 @@
{% endblock %}
</div>
{% endblock %}
-{% block document-ready %}{{ block.super }}
- require(['jquery.rating', 'extensions'], function() {
- {% if is_rejected %}
- $(".extension .switch").addClass("insensitive");
- {% endif %}
- $(".extension").addExtensionSwitch();
- $(".comment .rating").each(function() {
- $(this).find('input').rating();
- });
- $("form .rating").rating();
- });
-{% endblock %}
{% block navclass %}main{% endblock %}
diff --git a/sweettooth/static/js/main.js b/sweettooth/static/js/main.js
index 89da7af..8917aca 100644
--- a/sweettooth/static/js/main.js
+++ b/sweettooth/static/js/main.js
@@ -1,8 +1,8 @@
"use strict";
-require(['jquery', 'messages',
+require(['jquery', 'messages', 'extensions',
'jquery.cookie', 'jquery.jeditable',
- 'jquery.timeago', 'extensions'], function($, messages) {
+ 'jquery.timeago', 'jquery.rating'], function($, messages) {
if (!$.ajaxSettings.headers)
$.ajaxSettings.headers = {};
@@ -91,6 +91,11 @@ require(['jquery', 'messages',
$('#local_extensions').addLocalExtensions();
$('#error_report').fillInErrors();
+ $('.extension').addExtensionSwitch();
+ $('.comment .rating').each(function() {
+ $(this).find('input').rating();
+ });
+ $('form .rating').rating();
if (window._SW)
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]