Commits

Rafał Kos committed ad3ef1c

Added icons in dialog buttons. Fix in jqueryui css.

Comments (0)

Files changed (3)

homebudget/public/css/jquery-ui-1.8.2.custom.css

 .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: 6px; top: 50%; width: 16px; margin: -9px 0 0 0; height: 16px; }
 .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; background: url(images/icon_sprite.png) 0px -16px no-repeat; }
 .ui-dialog-titlebar .ui-state-hover { -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; border: 0px none; background: transparent; }
-.ui-dialog .ui-state-hover span { background-position: -16px -16px ; }
+
 .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
 .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; font-size: 12px; }
 .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }

homebudget/public/js/scripts.js

             $('#ammount').val('-' + ammount);            
         }
     });
+
+    $('#name').focus();
 });

homebudget/templates/base/main.html

                             $('#calendar').fullCalendar('refetchEvents');
                         }
                     })
+                },
+                '{{ _('Close') }}': function() {
+                    $(this).dialog('close');
                 }
             }
         };
                             $('#dialog-form').html(msg);
                         }
                     })
+                },
+                '{{ _('Close') }}': function() {
+                    $(this).dialog('close');
                 }
             }
         };
         $('#dialog-form').dialog({
             autoOpen: false,
             modal: true,
-            width: 580            
+            width: 580,
+            open: function() {
+                $('.ui-dialog-buttonpane')
+                    .find('button:contains({{ _('Close') }})')
+                    .removeClass('ui-button-text-only')
+                    .addClass('ui-button-text-icon')
+                    .prepend('<span class="ui-icon ui-icon-close"></span>');
+
+                $('.ui-dialog-buttonpane')
+                    .find('button:contains({{ _('Delete') }})')
+                    .removeClass('ui-button-text-only')
+                    .addClass('ui-button-text-icon')
+                    .prepend('<span class="ui-icon ui-icon-trash"></span>');
+
+                $('.ui-dialog-buttonpane')
+                    .find('button:contains({{ _('Save') }})')
+                    .removeClass('ui-button-text-only')
+                    .addClass('ui-button-text-icon')
+                    .prepend('<span class="ui-icon ui-icon-trash"></span>');
+            }
         });