Permalink
Browse files

rows re-number prperly (like LeanCalc)

  • Loading branch information...
1 parent 9a45dbb commit 6cbb4dca6ad01051fa4f5b93241f4c21ab6663cc @alexkingorg committed Jan 28, 2011
Showing with 24 additions and 3 deletions.
  1. +24 −3 index.html
View
@@ -7,9 +7,15 @@
- styling
- html storage to save page locally
- ability to delete rows
-- redo row numbering in inverse order
- show row numbers
- auto-scroll rows up
+- allow re-ordering of rows?
+
+TEST:
+
+- iPhone
+- Android
+- BlackBerry (6)
-->
@@ -92,8 +98,23 @@
// create new line
var $eqs = $('.equation');
var $eq = $('.equation:first').clone();
- var row = $eqs.size() + 1;
- $eq.attr('data-row', row).find(':input').val('').end().appendTo('.equations');
+ $eq.find(':input').val('').end().appendTo('.equations');
+ var i = 0;
+ var row = '';
+ $($('.equation').get().reverse()).each(function() {
+// re-number rows
+ if (i == 10) {
+ row = 0;
+ }
+ else if (i >= 1 && i <= 9) {
+ row = i;
+ }
+ else {
+ row = '';
+ }
+ $(this).attr('data-row', row);
+ i++;
+ });
$('.equation:last :input:first').focus();
});
});

0 comments on commit 6cbb4dc

Please sign in to comment.