Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fadeIn effect working for new message at last.

  • Loading branch information...
commit d7fb62abd4a2086b8e3e4a83c50bbbe4aa28499c 1 parent 637c5a3
Aaron Kavlie authored
5 sms/static/style.css
@@ -7,9 +7,8 @@ body {
7 7 margin: 50px 200px;
8 8 }
9 9
10   -.clear {
11   - clear: both;
12   -}
  10 +.clear {clear: both;}
  11 +.hidden {display: none;}
13 12
14 13 h1 {
15 14 font-size: 40px;
16 sms/templates/index.html
@@ -6,17 +6,25 @@
6 6 $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
7 7
8 8 $(function() {
  9 + $('#test').click(function() {
  10 + $('.sent_message:first').slideToggle(1000);
  11 + });
  12 +
9 13 $("#sms_form").submit(function() {
10   - $.post("/sms", $("#sms_form").serialize(),
  14 + $.post("/sms", $("#sms_form").serialize(),
11 15 function(data) {
12   - $('#status').html(data.status);
13   - }, 'json');
  16 + $('#sent_message_list').prepend(data);
  17 + $('.sent_message:first').fadeIn(1000);
  18 + });
14 19 return false;
15 20 });
  21 +
16 22 });
17 23
18 24 </script>
19 25
  26 +<button id="test">Test!</button>
  27 +
20 28 <form id="sms_form" action="">
21 29 <p><label for="phone">Phone Number: </label>
22 30 <input type="text" name="phone_number" /></p>
@@ -32,8 +40,8 @@
32 40 </div>
33 41
34 42 {% if sent_messages %}
35   - <div id="sent_message_list">
36 43 <h2>Message History</h2>
  44 + <div id="sent_message_list">
37 45 {% for message in sent_messages %}
38 46 <div class="sent_message">
39 47 <div class="status">{{ message.status }}</div>
2  sms/views.py
@@ -25,4 +25,4 @@ def sms():
25 25 db.session.commit()
26 26
27 27 # flash('SMS sent to %s' % request.form['phone_number'])
28   - return tw_response
  28 + return render_template('sent_message.html', sms=sms_data)
BIN  sms/views.pyc
Binary file not shown

0 comments on commit d7fb62a

Please sign in to comment.
Something went wrong with that request. Please try again.