Commits

ditto committed becfca6

WebKit 계열 브라우저에서 사진 못 올리는 문제 수정

Comments (0)

Files changed (2)

foodcapsule/static/style.css

 #geolocation a { font-weight: bold; }
 #geolocation .button { display: inline-block; border-radius: 20px; }
 #id_location { width: 75%; }
-#metadata-bar { margin: 0 auto; padding: 0; list-style: none; overflow: hidden; width: 303px; }
-#metadata-bar input { display: none; }
+#metadata-bar { margin: 0 auto; padding: 0; list-style: none; overflow: hidden; width: 273px; }
 #metadata-bar li {
     background: #f8f8f8 url(button-bg.gif) repeat-x bottom;
     overflow: hidden;
-    width: 100px;
+    width: 90px;
     border: 1px solid #ddd;
     border-top: 0; border-left: 0;
     float: left;
     border: none;
     height: 100%;
 }
-#btn-upload-photo { border-radius: 10px 0 0 10px; }
-#btn-change-time  { border-radius: 0 10px 10px 0px; }
-#btn-upload-photo a { background: url(icon-camera.png) no-repeat center 15px; }
+#btn-upload-photo { border-radius: 10px 0 0 10px; position: relative; }
+#btn-upload-photo input { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
+#btn-upload-photo span { background: url(icon-camera.png) no-repeat center 15px; }
 #btn-locate a { background: url(icon-location.png) no-repeat center 15px; }
 #btn-locate a.requesting { background-image: url(progress.gif); }
+#btn-change-time  { border-radius: 0 10px 10px 0px; }
 #btn-change-time { position: relative; }
 #btn-change-time span { background: url(icon-clock.png) no-repeat center 12px; }
 #btn-change-time select { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

foodcapsule/templates/new_post.html

 
 <ul id="metadata-bar">
     <li id="btn-upload-photo">
+        <span>사진 올리기</span>
         {{ form.photo }}
-        <a href="#">사진 올리기</a>
     </li>
     <li id="btn-locate"><a href="#">위치 입력</a></li>
     <li id="btn-change-time">
         $('#foods tr').show();
     });
 
-    var photoLoaded = false;
     $('#id_photo').change(function() {
-        photoLoaded = true;
-        $('#btn-upload-photo a').text('사진 추가됨');
-    });
-    $('#btn-upload-photo a').click(function(e) {
-        e.preventDefault();
-        if (!photoLoaded)
-            $('#id_photo').click();
+        if (this.value != '') {
+            photoLoaded = true;
+            $('#btn-upload-photo span').text('사진 추가됨');
+        }
     });
     
     initTimePicker();