Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix CoverPhoto Upload UI Buttons

  • Loading branch information...
commit 9fa9aa815afb6bfc1290ebac59223b898f1da62c 1 parent fbc0f9e
@cpojer cpojer authored
View
7 JavaScript/App/CoverPhoto.js
@@ -1,4 +1,5 @@
var UI = require('UI');
+var Popover = require('UI/Actions/Popover');
var CordovaImageRecorder = require('Capture/CordovaImageRecorder');
@@ -81,9 +82,11 @@ exports.createView = function(store, object) {
var attachListeners = function() {
var container = object.toElement();
- container.getElement('.upload_take_photo').addEvent('click', uploadTakePhoto);
- container.getElement('.upload_from_library').addEvent('click', uploadFromLibrary);
container.getElement('.remove_thumbnail a').addEvent('click', removeCoverPhoto);
+
+ var popover = container.getElement('.upload-cover-photo').getInstanceOf(Popover).getPopover();
+ popover.getElement('.upload_take_photo').addEvent('click', uploadTakePhoto);
+ popover.getElement('.upload_from_library').addEvent('click', uploadFromLibrary);
};
object.addEvent('show:once', attachListeners);
View
2  JavaScript/Templates.js
@@ -1149,7 +1149,7 @@ function program3(depth0,data) {
stack1 = depth0.thumbnail;
stack1 = helpers.unless.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(1, program1, data)});
if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\" />\n<ul>\n <li>\n <label class=\"show-popover\">\n Upload\n <div class=\"hidden popover top justify\" data-position=\"top\">\n <a href=\"#\" class=\"button expand upload_take_photo\">Take a Photo</a>\n <a href=\"#\" class=\"button expand upload_from_library\">Choose from Library</a>\n </div>\n </label>\n </li>\n <li class=\"remove_thumbnail";
+ buffer += "\" />\n<ul>\n <li>\n <label class=\"upload-cover-photo show-popover\">\n Upload\n <div class=\"hidden popover top justify\" data-position=\"top\">\n <a href=\"#\" class=\"button expand upload_take_photo\">Take a Photo</a>\n <a href=\"#\" class=\"button expand upload_from_library\">Choose from Library</a>\n </div>\n </label>\n </li>\n <li class=\"remove_thumbnail";
stack1 = depth0.thumbnail;
stack1 = helpers.unless.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(3, program3, data)});
if(stack1 || stack1 === 0) { buffer += stack1; }
View
2  Templates/form-new-metadata.handlebars
@@ -17,7 +17,7 @@
<img src="{{{image thumbnail}}}" class="thumbnail{{#unless thumbnail}} hidden{{/unless}}" />
<ul>
<li>
- <label class="show-popover">
+ <label class="upload-cover-photo show-popover">
Upload
<div class="hidden popover top justify" data-position="top">
<a href="#" class="button expand upload_take_photo">Take a Photo</a>
Please sign in to comment.
Something went wrong with that request. Please try again.