From 37381fdf606e4d9abde5188ab867dfa5acabfbb0 Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 3 Apr 2016 11:57:13 +0800 Subject: [PATCH] tweaked preformance of preview operations --- assets/js/preview.utils.js | 13 +++++++++---- templates/admin/show.tpl.php | 6 +++--- user/index.php | 8 ++++---- user/upload.php | 8 ++++---- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/assets/js/preview.utils.js b/assets/js/preview.utils.js index dd9662c0..252a6ae2 100644 --- a/assets/js/preview.utils.js +++ b/assets/js/preview.utils.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-03-27 09:43:57 * @Last Modified by: printempw -* @Last Modified time: 2016-04-02 20:20:52 +* @Last Modified time: 2016-04-03 11:55:42 */ 'use strict'; @@ -27,6 +27,7 @@ $(document).ready(function(){ show2dPreview(); } else { init3dCanvas(); + MSP.setStatus("rotation", false); } }); @@ -34,13 +35,17 @@ $(document).ready(function(){ $(window).resize(init3dCanvas); // Change 3D preview status -$("[title='Movements']").click(function(){ +$('.fa-pause').click(function(){ MSP.setStatus("movements", !MSP.getStatus("movements")); + if ($(this).hasClass('fa-pause')) + $(this).removeClass('fa-pause').addClass('fa-play'); + else + $(this).removeClass('fa-play').addClass('fa-pause'); }); -$("[title='Running']").click(function(){ +$('.fa-forward').click(function(){ MSP.setStatus("running", !MSP.getStatus("running")); }); -$("[title='Rotation']").click(function(){ +$('.fa-repeat').click(function(){ MSP.setStatus("rotation", !MSP.getStatus("rotation")); }); diff --git a/templates/admin/show.tpl.php b/templates/admin/show.tpl.php index 83dc444b..065d68e4 100644 --- a/templates/admin/show.tpl.php +++ b/templates/admin/show.tpl.php @@ -79,9 +79,9 @@

皮肤预览 切换 2D 预览
- - - + + +

diff --git a/user/index.php b/user/index.php index 4151c949..21350645 100644 --- a/user/index.php +++ b/user/index.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-21 13:56:40 * @Last Modified by: printempw - * @Last Modified time: 2016-03-27 09:45:18 + * @Last Modified time: 2016-04-03 11:50:47 */ require "../libraries/session.inc.php"; $data['style'] = <<< 'EOT' @@ -53,9 +53,9 @@ View::show('header', $data);

皮肤预览 切换 2D 预览
- - - + + +

diff --git a/user/upload.php b/user/upload.php index 5f2a39cf..d6ffd8c5 100644 --- a/user/upload.php +++ b/user/upload.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-03-18 21:41:21 * @Last Modified by: printempw - * @Last Modified time: 2016-03-27 09:45:12 + * @Last Modified time: 2016-04-03 11:51:49 */ require "../libraries/session.inc.php"; $data['style'] = <<< 'EOT' @@ -62,9 +62,9 @@ View::show('header', $data);

即时预览 切换 2D 预览
- - - + + +