Explorar o código

fixed flag nav bug

Bachir Soussi Chiadmi %!s(int64=6) %!d(string=hai) anos
pai
achega
fa07acdd31

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
sites/all/modules/gui/materiobasemod/js/dist/materio_flag.min.js


+ 11 - 7
sites/all/modules/gui/materiobasemod/js/materio_flag.js

@@ -39,13 +39,14 @@ MaterioFlag = function(){
   };
 
   function onResultsUpdated(event){
-    //trace('MaterioFlag :: onResultsUpdated', event);
+    trace('MaterioFlag :: onResultsUpdated', event);
+    ajaxifyTitleTools();
     ajaxifyLinks(event.container);
   };
 
   function buildBlocks(activename){
     //trace('MaterioFlag :: buildBlocks | activename', activename);
-
+    // TODO: the bookmark thing is obselete as free registrered user does not exist anymore
     if($('#block-materio-flag-materio-flag-mybookmarks').length){
       var type = 'bookmarks';
       var block = '#block-materio-flag-materio-flag-mybookmarks';
@@ -78,10 +79,7 @@ MaterioFlag = function(){
           $('<span class="preview"><i class="fi-eye"></i></span>').attr('name', name).insertAfter($this).bind('click', onClickShowPreview);
         });
 
-        $('a.edit-list:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists-nav')
-          .bind('click', onCLickEditList)
-          .addClass('ajax-processed');
-
+        ajaxifyTitleTools();
 
         $('a.flag-lists-create:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists-nav')
           .bind('click', onClickCreatLink)
@@ -118,8 +116,14 @@ MaterioFlag = function(){
       showPreview(activename, block);
   };
 
+  function ajaxifyTitleTools(){
+    $('a.edit-list:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists-nav, #block-materio-page-title-materio-page-title')
+      .bind('click', onCLickEditList)
+      .addClass('ajax-processed');
+  };
+
   function refreshBlocks(name){
-    //trace('MaterioFlag :: refreshBlocks | name', name);
+    trace('MaterioFlag :: refreshBlocks | name', name);
     if($('#block-materio-flag-materio-flag-mybookmarks').length){
       var type = 'bookmarks';
     }else if($('#block-materio-flag-materio-flag-mylists').length){

+ 2 - 2
sites/all/modules/gui/materiobasemod/templates/materio-flag-mylists-block.tpl.php

@@ -14,6 +14,6 @@
 			<?php $content = $list['content']; ?>
 			<?php $entity_view = entity_view('node', $content, $viewmode); ?>
 			<div class="flaged <?php print $list['list']->name; ?>">	<?php print render($entity_view); ?> </div>
-		</section>	
+		</section>
 	<?php endforeach; ?>
-</div>
+</div>

+ 13 - 8
sites/all/modules/gui/materiobasemod/templates/materio-flag-mylists-nav-block.tpl.php

@@ -4,25 +4,30 @@
 			<?php foreach ($flags as $name => $flag): ?>
 			<?php //dsm($flag, 'flag') ;?>
 				<li class="flaglist <?php print $flag->name; ?>">
-					<?php print l($flag->title . '<span class="count">('.count($flag->flaged_content).')</span>', 'lists/'.$flag->fid, array('html'=>true,'attributes'=>array('class'=>array('open-list', $flag->name)))); ?>
+					<?php
+					//dsm($list, 'list');
+						$flag_title = $flag->title;
+						$flag_title = (strlen($flag_title) > 20) ? substr($flag_title,0,20).'...' : $flag_title;
+					?>
+					<?php print l($flag_title . '<span class="count">('.count($flag->flaged_content).')</span>', 'lists/'.$flag->fid, array('html'=>true,'attributes'=>array('class'=>array('open-list', $flag->name)))); ?>
 					<?php if(flag_lists_is_owner('edit', $flag->fid)): ?>
-						<?php 
-						print l('<i class="fi-wrench"></i>', 
-							'flags/lists/edit/'.$flag->fid, 
+						<?php
+						print l('<i class="fi-wrench"></i>',
+							'flags/lists/edit/'.$flag->fid,
 							array(
 								'html'=>true,
 								'attributes'=>array('class'=>array('edit-list', $flag->name)),
 							)
-						); 
+						);
 						?>
 					<?php endif; ?>
 				</li>
 			<?php endforeach; ?>
 		<?php else: ?>
-			<?php 
+			<?php
 				#create new list
 		    $create_link = l(
-		      '<i class="fi-plus"></i>&nbsp;<span>' . t('New @name', array('@name' => t(variable_get('flag_lists_name', 'list')))) . '</span>', 
+		      '<i class="fi-plus"></i>&nbsp;<span>' . t('New @name', array('@name' => t(variable_get('flag_lists_name', 'list')))) . '</span>',
 		      'flag-lists/add/materiau',
 		      array(
 		        'attributes' => array(
@@ -36,4 +41,4 @@
 			<li class="flag-lists-create"><?php print $create_link; ?>	</li>
 		<?php endif; ?>
 	</ul>
-</section>
+</section>

+ 4 - 2
sites/all/themes/gui/materiobasetheme/css/styles.css

@@ -6560,7 +6560,8 @@ article.node-materiau.vm-cardfull, article.node-breve.vm-cardfull {
     #modal form input.form-text, #modal form textarea, #modal form div.grippie {
       background-color: #fff;
       color: #000;
-      border: 0; }
+      border: 0;
+      max-width: 100%; }
     #modal form .form-actions {
       text-align: right; }
     #modal form input.form-submit {
@@ -6830,7 +6831,8 @@ article.node-materiau.vm-cardfull, article.node-breve.vm-cardfull {
     #block-feedback-form .content form input.form-text, #block-feedback-form .content form textarea, #block-feedback-form .content form div.grippie {
       background-color: #fff;
       color: #000;
-      border: 0; }
+      border: 0;
+      max-width: 100%; }
     #block-feedback-form .content form .form-actions {
       text-align: right; }
     #block-feedback-form .content form input.form-submit {

+ 1 - 1
sites/all/themes/gui/materiobasetheme/scss/styles.scss

@@ -2255,7 +2255,7 @@ body.print-body-materiau{
     .form-actions{
       background-color:transparent; margin: 0; padding: 0; border: 0;
     }
-    input.form-text, textarea, div.grippie{background-color:#fff; color:#000; border: 0;}
+    input.form-text, textarea, div.grippie{background-color:#fff; color:#000; border: 0; max-width: 100%; }
 
     .form-actions{ text-align: right ;}
     input.form-submit{

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio