Permalink
Browse files

Remove default background color from scroll and image view

  • Loading branch information...
koenbok committed Apr 20, 2014
1 parent fad01d1 commit e95bf6ba82d4241f9753d5cd21277dd4972e6212
Showing with 23 additions and 16 deletions.
  1. +12 −4 build/framer.js
  2. +2 −10 extras/CactusFramerTest/static/app-cs.coffee
  3. +5 −1 src/views/imageview.coffee
  4. +4 −1 src/views/scrollview.coffee
View
@@ -1,7 +1,7 @@
// Framer 2.0-62-g449b155 (c) 2013 Koen Bok
// Framer 2.0-64-gfad01d1 (c) 2013 Koen Bok
// https://github.com/koenbok/Framer
window.FramerVersion = "2.0-62-g449b155";
window.FramerVersion = "2.0-64-gfad01d1";
(function(){var require = function (file, cwd) {
@@ -648,6 +648,10 @@ require.define("/src/utils.coffee",function(require,module,exports,__dirname,__f
return window.location.href.slice(0, 7) === "file://";
};
exports.isLocalFile = function(url) {
return url.slice(0, 7) === "file://";
};
exports.devicePixelRatio = function() {
return window.devicePixelRatio;
};
@@ -4291,12 +4295,13 @@ require.define("/src/views/scrollview.coffee",function(require,module,exports,__
exports.ScrollView = (function(_super) {
__extends(ScrollView, _super);
function ScrollView() {
function ScrollView(args) {
ScrollView.__super__.constructor.apply(this, arguments);
this.style["overflow"] = "scroll";
this.style["-webkit-overflow-scrolling"] = "touch";
this.style["overflow-x"] = "scroll";
this.style["overflow-y"] = "scroll";
this.style.backgroundColor = null;
}
ScrollView.define("scrollVertical", {
@@ -4391,11 +4396,14 @@ require.define("/src/views/imageview.coffee",function(require,module,exports,__d
set: function(value) {
var loader, _ref, _ref1,
_this = this;
if (value) {
this.style.backgroundColor = null;
}
if (this._image === value) {
return this.emit("load", loader);
}
this._image = config.baseUrl + value;
if (utils.isLocal()) {
if (utils.isLocalFile(this._image)) {
this._image += "?nocache=" + (Date.now());
}
if ((_ref = this.events) != null ? _ref.hasOwnProperty("load" || ((_ref1 = this.events) != null ? _ref1.hasOwnProperty("error") : void 0)) : void 0) {
@@ -1,10 +1,2 @@
viewA = new View x:20, y:20, width:100, height:100
viewB = new View x:0, y:0, width:50, height:50, superView: viewA
viewC = new ImageView x:20, y:20, width:20, height:20, superView: viewB
viewC.image = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/t1.0-1/c9.9.112.112/s50x50/1002105_10201417272264644_314604545_s.jpg"
for i in [1..10]
viewACopy = viewA.copy()
viewACopy.x = 25 * i
viewACopy.y = 25 * i
viewA = new ScrollView x:20, y:20, width:100, height:100
viewB = new View x:20, y:20, width:100, height:100, superView:viewA
@@ -23,14 +23,18 @@ class exports.ImageView extends View
set: (value) ->
if value
# Undo the setting of the default background color
@style.backgroundColor = null
if @_image is value
return @emit "load", loader
# Add the optional base url from the config
@_image = config.baseUrl + value
# If the file is local, we want to avoid caching
if utils.isLocal()
if utils.isLocalFile @_image
@_image += "?nocache=#{Date.now()}"
# As an optimization, we will only use a loader
@@ -2,13 +2,16 @@
{View} = require "./view"
class exports.ScrollView extends View
constructor: ->
constructor: (args) ->
super
@style["overflow"] = "scroll"
@style["-webkit-overflow-scrolling"] = "touch"
@style["overflow-x"] = "scroll"
@style["overflow-y"] = "scroll"
@style.backgroundColor = null
# # Hack to disable rubber banding on ios devices
# startY = startTopScroll = deltaY = undefined

0 comments on commit e95bf6b

Please sign in to comment.