Browse files

illustrate horizontal scrolling problem

  • Loading branch information...
1 parent 31e3d15 commit 528a2a2e9bce4693a49bdc50ae4590a073ccb8bf @bdimcheff committed Sep 20, 2010
Showing with 106 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +8 −0 Buildfile
  3. +8 −0 README
  4. +27 −0 apps/horiz/core.js
  5. +30 −0 apps/horiz/main.js
  6. +9 −0 apps/horiz/resources/loading.rhtml
  7. +23 −0 apps/horiz/resources/main_page.js
View
1 .gitignore
@@ -0,0 +1 @@
+tmp
View
8 Buildfile
@@ -0,0 +1,8 @@
+# ===========================================================================
+# Project: Sproutcore-horizontal-scroll
+# Copyright: ©2010 My Company, Inc.
+# ===========================================================================
+
+# Add initial buildfile information here
+config :all, :required => :sproutcore, :theme => ['sproutcore/ace']
+
View
8 README
@@ -0,0 +1,8 @@
+=============================================================================
+Project: Sproutcore-horizontal-scroll
+Copyright: ©2010 My Company, Inc.
+=============================================================================
+
+SC.StaticContentView inside a ScrollView doesn't scroll horizontally if there is extra content to the right.
+
+quilmes is installed as a submodule in frameworks/, so you need to do "git submodule init" to set that up
View
27 apps/horiz/core.js
@@ -0,0 +1,27 @@
+// ==========================================================================
+// Project: Horiz
+// Copyright: ©2010 My Company, Inc.
+// ==========================================================================
+/*globals Horiz */
+
+/** @namespace
+
+ My cool new app. Describe your application.
+
+ @extends SC.Object
+*/
+Horiz = SC.Application.create(
+ /** @scope Horiz.prototype */ {
+
+ NAMESPACE: 'Horiz',
+ VERSION: '0.1.0',
+
+ // This is your application store. You will use this store to access all
+ // of your model data. You can also set a data source on this store to
+ // connect to a backend server. The default setup below connects the store
+ // to any fixtures you define.
+ store: SC.Store.create().from(SC.Record.fixtures)
+
+ // TODO: Add global constants or singleton objects needed by your app here.
+
+}) ;
View
30 apps/horiz/main.js
@@ -0,0 +1,30 @@
+// ==========================================================================
+// Project: Horiz
+// Copyright: ©2010 My Company, Inc.
+// ==========================================================================
+/*globals Horiz */
+
+// This is the function that will start your app running. The default
+// implementation will load any fixtures you have created then instantiate
+// your controllers and awake the elements on your page.
+//
+// As you develop your application you will probably want to override this.
+// See comments for some pointers on what to do next.
+//
+Horiz.main = function main() {
+
+ // Step 1: Instantiate Your Views
+ // The default code here will make the mainPane for your application visible
+ // on screen. If you app gets any level of complexity, you will probably
+ // create multiple pages and panes.
+ Horiz.getPath('mainPage.mainPane').append() ;
+
+ // Step 2. Set the content property on your primary controller.
+ // This will make your app come alive!
+
+ // TODO: Set the content property on your primary controller
+ // ex: Horiz.contactsController.set('content',Horiz.contacts);
+
+} ;
+
+function main() { Horiz.main(); }
View
9 apps/horiz/resources/loading.rhtml
@@ -0,0 +1,9 @@
+<% content_for :loading do %>
+<% # Any HTML in this file will be visible on screen while your page loads
+ # its application JavaScript. SproutCore applications are optimized for
+ # caching and startup very fast, so your users will often only see this
+ # content for a brief moment on their first app load, if at all.
+%>
+<p class="loading">Loading...<p>
+
+<% end %>
View
23 apps/horiz/resources/main_page.js
@@ -0,0 +1,23 @@
+// ==========================================================================
+// Project: Horiz - mainPage
+// Copyright: ©2010 My Company, Inc.
+// ==========================================================================
+/*globals Horiz */
+
+// This page describes the main user interface for your application.
+Horiz.mainPage = SC.Page.design({
+
+ // The main pane is made visible on screen as soon as your app is loaded.
+ // Add childViews to this pane for views to display immediately on page
+ // load.
+ mainPane: SC.MainPane.design({
+ childViews: 'scrollView'.w(),
+
+ scrollView: SC.ScrollView.design({
+ layout: { top: 0, right: 0, bottom: 0, left: 0 },
+ contentView: SC.StaticContentView.design({
+ content: "<pre>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</pre>"
+ })
+ })
+ })
+});

0 comments on commit 528a2a2

Please sign in to comment.