diff options
author | Aaron Parecki <aaron@parecki.com> | 2015-09-05 13:21:36 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2015-09-05 13:21:36 -0700 |
commit | 881550cac72bfcc2e7551fe13288ea8a1d27ca34 (patch) | |
tree | 0f675deafd3694c1cd73550d7ef9da178facc677 /public/editor | |
parent | e121c3f582e2a746dba18b2e9816a7d50e0ef3c2 (diff) |
better state management for editor
Diffstat (limited to 'public/editor')
-rw-r--r-- | public/editor/editor.js | 10 | ||||
-rw-r--r-- | public/editor/style.css | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/public/editor/editor.js b/public/editor/editor.js index 5a07e08..526a444 100644 --- a/public/editor/editor.js +++ b/public/editor/editor.js @@ -41,6 +41,10 @@ $(function() { $('#publish_btn').click(function(){ if($('.publish-dropdown').hasClass('hidden')) { $('.publish-dropdown').removeClass('hidden'); + $('#publish-confirm').show(); + $('#publish-success').addClass('hidden'); + $('#publish-error').addClass('hidden'); + $('#publish-help').removeClass('hidden'); } else { $('.publish-dropdown').addClass('hidden'); } @@ -89,13 +93,15 @@ $(function() { function reset_page() { $("#post-name").val(''); + $("#content").html(''); $("#draft-status").text("New"); + $("#publish-confirm").hide(); return localforage.setItem('currentdraft', {}); } function onUpdateReady() { // Show the notice that says there is a new version of the app - $("#new_version_available").show(); + $("#new_version_available").show(); } window.applicationCache.addEventListener('updateready', onUpdateReady); @@ -128,6 +134,8 @@ $(function(){ $("#post-name").val(val.title); $("#content").html(val.body); $("#draft-status").text("Restored"); + // drop the cursor into the editor which clears the placeholder text + $("#content").focus().click(); } }); }); diff --git a/public/editor/style.css b/public/editor/style.css index f646198..8ae753a 100644 --- a/public/editor/style.css +++ b/public/editor/style.css @@ -206,7 +206,8 @@ body, input { margin-bottom: 20px; border: 0; font-weight: bold; - font-size: 42px; + font-size: 38px; + width: 100%; } #content { |