From 1b8586c07951accbc3c0f3951966e4e258b0c5d9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 4 Jun 2012 15:34:57 -0700 Subject: Adding saving blocking screen This is for chrome preview, also fixed other preview bug with plain files not opening in preview. --- js/ninja.reel/ninja.js | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index a12270a0..38f5efcf 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -4,10 +4,11 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component, - UndoManager = require("montage/core/undo-manager").UndoManager, - AppData = require("js/data/appdata").AppData; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, + UndoManager = require("montage/core/undo-manager").UndoManager, + AppData = require("js/data/appdata").AppData, + Popup = require("js/components/popup.reel").Popup; var matrix = require("js/lib/math/matrix"); var NjUtils = require("js/lib/NJUtils").NJUtils; @@ -194,15 +195,45 @@ exports.Ninja = Montage.create(Component, { }, + //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //TODO: Expand method to allow other browsers for preview executeChromePreview: { value: function () { - this.currentDocument.model.browserPreview('chrome'); + //TODO: Make into proper component + this.saveOperationScreen = {}; + this._saveOperationPopup = {}; + //Show + this.saveOperationScreen.show = function (ctxt) { + // + ctxt._saveOperationPopup.blackout = document.createElement('div'); + ctxt._saveOperationPopup.blackout.style.width = '100%'; + ctxt._saveOperationPopup.blackout.style.height = '100%'; + ctxt._saveOperationPopup.blackout.style.background = 'rgba(0,0,0,0.8)'; //'-webkit-radial-gradient(center, ellipse cover, rgba(0,0,0,.65) 0%, rgba(0,0,0,0.8) 80%)'; + ctxt.application.ninja.popupManager.addPopup(ctxt._saveOperationPopup.blackout); + }; + //Hide + this.saveOperationScreen.hide = function (ctxt) { + ctxt.application.ninja.popupManager.removePopup(ctxt._saveOperationPopup.blackout); + }; + // + this.currentDocument.model.browserPreview('chrome', this.saveOperationScreen, this); } }, //////////////////////////////////////////////////////////////////// + //TODO: Make into proper component + _saveOperationPopup: { + value: null + }, + //TODO: Make into proper component + saveOperationScreen: { + value: null + }, + + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + handleResize: { value: function() { -- cgit v1.2.3