[extensions-web/feature/static-manifests] static: tell raty where to find static images



commit a55803dd7ffaeea09c912910f553029a49952113
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Mon Jan 30 19:33:35 2017 +0400

    static: tell raty where to find static images

 sweettooth/static/js/main.js |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/static/js/main.js b/sweettooth/static/js/main.js
index 424f8da..78d0728 100644
--- a/sweettooth/static/js/main.js
+++ b/sweettooth/static/js/main.js
@@ -1,10 +1,10 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 define(['jquery', 'messages', 'modal', 'hashParamUtils',
-        'templates', 'extensions', 'uploader', 'fsui',
+        'templates', 'staticfiles', 'extensions', 'uploader', 'fsui',
         'jquery.cookie', 'jquery.jeditable',
         'jquery.timeago', 'jquery.raty', 'jquery.colorbox'],
-function($, messages, modal, hashParamUtils, templates) {
+function($, messages, modal, hashParamUtils, templates, staticfiles) {
     "use strict";
 
     if (!$.ajaxSettings.headers)
@@ -93,6 +93,16 @@ function($, messages, modal, hashParamUtils, templates) {
             size: 25
         });
 
+        if (staticfiles.getImage('images/star-empty.png'))
+        {
+            $.fn.raty.defaults.starOff = staticfiles.getImageFile('images/star-empty.png');
+        }
+
+        if (staticfiles.getImage('images/star-full.png'))
+        {
+            $.fn.raty.defaults.starOn = staticfiles.getImageFile('images/star-full.png');
+        }
+
         $.fn.ratify = function() {
             return this.each(function() {
                 $(this).raty({


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]