Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3334417866 for ; Thu, 2 Apr 2015 18:08:37 +0000 (UTC) Received: (qmail 91958 invoked by uid 500); 2 Apr 2015 18:08:34 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 91904 invoked by uid 500); 2 Apr 2015 18:08:34 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 91893 invoked by uid 99); 2 Apr 2015 18:08:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2015 18:08:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1316E2F4C; Thu, 2 Apr 2015 18:08:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: benkeen@apache.org To: commits@couchdb.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/master to e229a45 Date: Thu, 2 Apr 2015 18:08:33 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/master 2e64de7fe -> e229a45fc Allow customization of view loading styles By default, the core Fauxton code inserts a spinner for each view while it's loading. This can be removed via the disableLoader param but not customized. This PR lets you define an optional `loaderStyles` property on your view to override the styles. The use-case here is to provide a light-coloured loader on the dark- background Doc Editor page. I investigated using the new React spinner, but ran into problems targeting views that weren't loaded yet in the page load lifecycle. This seemed an elegant solution that tapped into what we already had. Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/e229a45f Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/e229a45f Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/e229a45f Branch: refs/heads/master Commit: e229a45fcee9bcf1282c99b57da96550254d5d48 Parents: 2e64de7 Author: Ben Keen Authored: Wed Apr 1 13:33:35 2015 -0700 Committer: Ben Keen Committed: Thu Apr 2 11:10:50 2015 -0700 ---------------------------------------------------------------------- app/addons/documents/views-doceditor.js | 6 ++++-- app/addons/fauxton/components.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e229a45f/app/addons/documents/views-doceditor.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views-doceditor.js b/app/addons/documents/views-doceditor.js index 3ac3554..0e2f4c7 100644 --- a/app/addons/documents/views-doceditor.js +++ b/app/addons/documents/views-doceditor.js @@ -209,8 +209,10 @@ function (app, FauxtonAPI, Components, Documents, Databases, prettify) { 'click a.js-back': 'onClickGoBack', 'click .code-region': 'focusOnLastLine' }, - - disableLoader: true, + loaderStyles: { + color: '#ffffff', + opacity: 0.15 + }, initialize: function (options) { this.database = options.database; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e229a45f/app/addons/fauxton/components.js ---------------------------------------------------------------------- diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js index df2a332..b2fdcaf 100644 --- a/app/addons/fauxton/components.js +++ b/app/addons/fauxton/components.js @@ -990,7 +990,7 @@ function (app, FauxtonAPI, ace, spin, ZeroClipboard) { removeRouteObjectSpinner(); if (!view.disableLoader) { - var opts = { + var opts = _.extend({ lines: 16, // The number of lines to draw length: 8, // The length of each line width: 4, // The line thickness @@ -999,7 +999,7 @@ function (app, FauxtonAPI, ace, spin, ZeroClipboard) { speed: 1, // Rounds per second trail: 10, // Afterglow percentage shadow: false // Whether to render a shadow - }; + }, view.loaderStyles); var viewSpinner = new Spinner(opts).spin(); $('
')